Bug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pair) constexpr.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186430 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2013-07-16 17:45:44 +00:00
parent 01a0e90783
commit 206f6cdc33
8 changed files with 135 additions and 30 deletions

View File

@@ -26,4 +26,15 @@ int main()
assert(std::get<0>(p) == 3);
assert(std::get<1>(p) == 4);
}
#if __cplusplus > 201103L
{
typedef std::pair<int, short> P;
constexpr P p1(3, 4);
static_assert(p1.first == 3, "" ); // for now!
static_assert(p1.second == 4, "" ); // for now!
// static_assert(std::get<0>(p1) == 3, "");
// static_assert(std::get<1>(p1) == 4, "");
}
#endif
}