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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user