In C++03, a bunch of the arithmetic/logical/comparison functors (such as add/equal_to/logical_or) were defined as deriving from binary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,7 +19,9 @@ int main()
|
||||
{
|
||||
typedef std::logical_and<int> F;
|
||||
const F f = F();
|
||||
static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
|
||||
static_assert((std::is_same<int, F::first_argument_type>::value), "" );
|
||||
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
|
||||
static_assert((std::is_same<bool, F::result_type>::value), "" );
|
||||
assert(f(36, 36));
|
||||
assert(!f(36, 0));
|
||||
assert(!f(0, 36));
|
||||
|
@@ -19,7 +19,9 @@ int main()
|
||||
{
|
||||
typedef std::logical_or<int> F;
|
||||
const F f = F();
|
||||
static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
|
||||
static_assert((std::is_same<int, F::first_argument_type>::value), "" );
|
||||
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
|
||||
static_assert((std::is_same<bool, F::result_type>::value), "" );
|
||||
assert(f(36, 36));
|
||||
assert(f(36, 0));
|
||||
assert(f(0, 36));
|
||||
|
Reference in New Issue
Block a user