Use standard enable_if

This commit is contained in:
Victor Zverovich
2017-08-26 10:41:58 -07:00
parent 64681739fd
commit 27ad6cee82
2 changed files with 8 additions and 32 deletions

View File

@@ -840,25 +840,6 @@ TEST(UtilTest, IsEnumConvertibleToInt) {
}
#endif
template <typename T>
bool check_enable_if(
typename fmt::internal::enable_if<sizeof(T) == sizeof(int), T>::type *) {
return true;
}
template <typename T>
bool check_enable_if(
typename fmt::internal::enable_if<sizeof(T) != sizeof(int), T>::type *) {
return false;
}
TEST(UtilTest, EnableIf) {
int i = 0;
EXPECT_TRUE(check_enable_if<int>(&i));
char c = 0;
EXPECT_FALSE(check_enable_if<char>(&c));
}
TEST(UtilTest, Conditional) {
int i = 0;
fmt::internal::conditional<true, int, char>::type *pi = &i;