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

@@ -18,8 +18,19 @@
int main()
{
{
typedef std::pair<float, short*> P;
P p;
assert(p.first == 0.0f);
assert(p.second == nullptr);
}
#if _LIBCPP_STD_VER > 11
{
typedef std::pair<float, short*> P;
constexpr P p;
static_assert(p.first == 0.0f, "");
static_assert(p.second == nullptr, "");
}
#endif
}