Skip to content

Commit fb8b170

Browse files
authored
Fixed bug in the definition of SFINAE helpers
Fixed bug with GCC < 8 (#55)
1 parent 048f74d commit fb8b170

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/tinyutf8/tinyutf8.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,11 +663,12 @@ namespace tiny_utf8
663663
//! Get the maximum number of bytes (excluding the trailing '\0') that can be stored within a basic_utf8_string object
664664
static constexpr inline size_type get_sso_capacity() noexcept { return sizeof(SSO::data); }
665665

666-
//! Helpers for the constructors
666+
//! SFINAE helpers for constructors
667667
template<size_type L>
668-
using enable_if_small_string = typename std::enable_if<( L <= get_sso_capacity() ), bool>::type;
668+
using enable_if_small_string = typename std::enable_if<( L <= sizeof(SSO::data) ), bool>::type;
669669
template<size_type L>
670-
using enable_if_not_small_string = typename std::enable_if<( L > get_sso_capacity() ), bool>::type;
670+
using enable_if_not_small_string = typename std::enable_if<( L > sizeof(SSO::data) ), bool>::type;
671+
671672
// Template to enable overloads, if the supplied type T is a character array without known bounds
672673
template<typename T, typename CharType, typename _DataType = bool>
673674
using enable_if_ptr = typename std::enable_if<

0 commit comments

Comments
 (0)