Make convert_to_int public (#818)

This commit is contained in:
Victor Zverovich
2018-08-22 07:40:06 -07:00
parent ba95e36a58
commit 987514761e
5 changed files with 32 additions and 28 deletions
+4 -4
View File
@@ -851,15 +851,15 @@ TEST(UtilTest, ReportWindowsError) {
enum TestEnum2 {};
TEST(UtilTest, ConvertToInt) {
EXPECT_FALSE((fmt::internal::convert_to_int<char, char>::value));
EXPECT_FALSE((fmt::internal::convert_to_int<const char *, char>::value));
EXPECT_TRUE((fmt::internal::convert_to_int<TestEnum2, char>::value));
EXPECT_FALSE((fmt::convert_to_int<char, char>::value));
EXPECT_FALSE((fmt::convert_to_int<const char *, char>::value));
EXPECT_TRUE((fmt::convert_to_int<TestEnum2, char>::value));
}
#if FMT_USE_ENUM_BASE
enum TestEnum : char {TestValue};
TEST(UtilTest, IsEnumConvertibleToInt) {
EXPECT_TRUE((fmt::internal::convert_to_int<TestEnum, char>::value));
EXPECT_TRUE((fmt::convert_to_int<TestEnum, char>::value));
}
#endif
+2 -2
View File
@@ -37,10 +37,10 @@ static std::wostream &operator<<(std::wostream &os, TestEnum) {
enum TestEnum2 {A};
TEST(OStreamTest, Enum) {
EXPECT_FALSE((fmt::internal::convert_to_int<TestEnum, char>::value));
EXPECT_FALSE((fmt::convert_to_int<TestEnum, char>::value));
EXPECT_EQ("TestEnum", fmt::format("{}", TestEnum()));
EXPECT_EQ("0", fmt::format("{}", A));
EXPECT_FALSE((fmt::internal::convert_to_int<TestEnum, wchar_t>::value));
EXPECT_FALSE((fmt::convert_to_int<TestEnum, wchar_t>::value));
EXPECT_EQ(L"TestEnum", fmt::format(L"{}", TestEnum()));
EXPECT_EQ(L"0", fmt::format(L"{}", A));
}