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:
@@ -38,5 +38,11 @@ int main()
|
||||
assert( f2(36L, 36));
|
||||
assert(!f2(36L, 0));
|
||||
assert(!f2(0L, 36));
|
||||
|
||||
constexpr bool foo = std::logical_and<int> () (36, 36);
|
||||
static_assert ( foo, "" );
|
||||
|
||||
constexpr bool bar = std::logical_and<> () (36.0, 36);
|
||||
static_assert ( bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
@@ -29,5 +29,11 @@ int main()
|
||||
assert( f2(0));
|
||||
assert(!f2(36L));
|
||||
assert( f2(0L));
|
||||
|
||||
constexpr bool foo = std::logical_not<int> () (36);
|
||||
static_assert ( !foo, "" );
|
||||
|
||||
constexpr bool bar = std::logical_not<> () (36);
|
||||
static_assert ( !bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
@@ -37,5 +37,11 @@ int main()
|
||||
assert(!f2(0, 0));
|
||||
assert(!f2(0, 0L));
|
||||
assert(!f2(0L, 0));
|
||||
|
||||
constexpr bool foo = std::logical_or<int> () (36, 36);
|
||||
static_assert ( foo, "" );
|
||||
|
||||
constexpr bool bar = std::logical_or<> () (36.0, 36);
|
||||
static_assert ( bar, "" );
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user