Skip to content

Commit

Permalink
use enable_if_t instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmherokiller committed Nov 5, 2023
1 parent 1f7c97f commit 4f029b2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions include/st_utf_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char16_t), char_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char16_t), char_buffer>
wchar_to_utf8(const wchar_t *wstr, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand All @@ -112,7 +112,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char32_t), char_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char32_t), char_buffer>
wchar_to_utf8(const wchar_t *wstr, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand Down Expand Up @@ -328,7 +328,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char32_t), utf32_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char32_t), utf32_buffer>
wchar_to_utf32(const wchar_t *wstr, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand Down Expand Up @@ -366,7 +366,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char16_t), wchar_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char16_t), wchar_buffer>
utf8_to_wchar(const char *utf8, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand All @@ -387,7 +387,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char32_t), wchar_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char32_t), wchar_buffer>
utf8_to_wchar(const char *utf8, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand Down Expand Up @@ -424,7 +424,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char16_t), wchar_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char16_t), wchar_buffer>
utf16_to_wchar(const char16_t *utf16, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand All @@ -434,7 +434,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char32_t), wchar_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char32_t), wchar_buffer>
utf16_to_wchar(const char16_t *utf16, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand Down Expand Up @@ -462,7 +462,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char16_t), wchar_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char16_t), wchar_buffer>
utf32_to_wchar(const char32_t *utf32, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand All @@ -483,7 +483,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char32_t), wchar_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char32_t), wchar_buffer>
utf32_to_wchar(const char32_t *utf32, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION)
{
Expand All @@ -500,7 +500,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char16_t), wchar_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char16_t), wchar_buffer>
latin_1_to_wchar(const char *astr, size_t size)
{
ST_ASSERT(size < ST_HUGE_BUFFER_SIZE, "String data buffer is too large");
Expand All @@ -518,7 +518,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char32_t), wchar_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char32_t), wchar_buffer>
latin_1_to_wchar(const char *astr, size_t size)
{
ST_ASSERT(size < ST_HUGE_BUFFER_SIZE, "String data buffer is too large");
Expand Down Expand Up @@ -639,7 +639,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char16_t), char_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char16_t), char_buffer>
wchar_to_latin_1(const wchar_t *wstr, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION,
bool substitute_out_of_range = true)
Expand All @@ -650,7 +650,7 @@ namespace ST

template <typename WcType = wchar_t>
ST_NODISCARD
typename std::enable_if<sizeof(WcType) == sizeof(char32_t), char_buffer>::type
std::enable_if_t<sizeof(WcType) == sizeof(char32_t), char_buffer>
wchar_to_latin_1(const wchar_t *wstr, size_t size,
utf_validation_t validation = ST_DEFAULT_VALIDATION,
bool substitute_out_of_range = true)
Expand Down

0 comments on commit 4f029b2

Please sign in to comment.