Implement n3789; constexpr support in named function objects
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -29,5 +29,11 @@ int main()
|
||||
assert(!f2(36, 6));
|
||||
assert(f2(36, 36.0));
|
||||
assert(f2(36.0, 36L));
|
||||
|
||||
constexpr bool foo = std::equal_to<int> () (36, 36);
|
||||
static_assert ( foo, "" );
|
||||
|
||||
constexpr bool bar = std::equal_to<> () (36.0, 36);
|
||||
static_assert ( bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
@@ -33,5 +33,11 @@ int main()
|
||||
assert( f2(36.0, 6));
|
||||
assert(!f2(6, 36.0));
|
||||
assert(!f2(6.0, 36));
|
||||
|
||||
constexpr bool foo = std::greater<int> () (36, 36);
|
||||
static_assert ( !foo, "" );
|
||||
|
||||
constexpr bool bar = std::greater<> () (36.0, 36);
|
||||
static_assert ( !bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
@@ -33,5 +33,11 @@ int main()
|
||||
assert( f2(36.0, 6));
|
||||
assert(!f2(6, 36.0));
|
||||
assert(!f2(6.0, 36));
|
||||
|
||||
constexpr bool foo = std::greater_equal<int> () (36, 36);
|
||||
static_assert ( foo, "" );
|
||||
|
||||
constexpr bool bar = std::greater_equal<> () (36.0, 36);
|
||||
static_assert ( bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
@@ -33,5 +33,11 @@ int main()
|
||||
assert(!f2(36.0, 6));
|
||||
assert( f2(6, 36.0));
|
||||
assert( f2(6.0, 36));
|
||||
|
||||
constexpr bool foo = std::less<int> () (36, 36);
|
||||
static_assert ( !foo, "" );
|
||||
|
||||
constexpr bool bar = std::less<> () (36.0, 36);
|
||||
static_assert ( !bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
@@ -33,5 +33,11 @@ int main()
|
||||
assert(!f2(36.0, 6));
|
||||
assert( f2(6, 36.0));
|
||||
assert( f2(6.0, 36));
|
||||
|
||||
constexpr bool foo = std::less_equal<int> () (36, 36);
|
||||
static_assert ( foo, "" );
|
||||
|
||||
constexpr bool bar = std::less_equal<> () (36.0, 36);
|
||||
static_assert ( bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
@@ -31,5 +31,11 @@ int main()
|
||||
assert( f2(36.0, 6));
|
||||
assert(!f2(36.0, 36));
|
||||
assert(!f2(36, 36.0));
|
||||
|
||||
constexpr bool foo = std::not_equal_to<int> () (36, 36);
|
||||
static_assert ( !foo, "" );
|
||||
|
||||
constexpr bool bar = std::not_equal_to<> () (36.0, 36);
|
||||
static_assert ( !bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user