Add tests to check the typedefs from the result of std::owner_less

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow 2015-01-07 20:54:51 +00:00
parent 58d4e04168
commit b15298338c

View File

@ -47,6 +47,10 @@ int main()
typedef std::owner_less<std::shared_ptr<int> > CS;
CS cs;
static_assert((std::is_same<std::shared_ptr<int>, CS::first_argument_type>::value), "" );
static_assert((std::is_same<std::shared_ptr<int>, CS::second_argument_type>::value), "" );
static_assert((std::is_same<bool, CS::result_type>::value), "" );
assert(!cs(p1, p2));
assert(!cs(p2, p1));
assert(cs(p1 ,p3) || cs(p3, p1));
@ -61,6 +65,10 @@ int main()
typedef std::owner_less<std::weak_ptr<int> > CS;
CS cs;
static_assert((std::is_same<std::weak_ptr<int>, CS::first_argument_type>::value), "" );
static_assert((std::is_same<std::weak_ptr<int>, CS::second_argument_type>::value), "" );
static_assert((std::is_same<bool, CS::result_type>::value), "" );
assert(!cs(w1, w2));
assert(!cs(w2, w1));
assert(cs(w1, w3) || cs(w3, w1));