constexpr support for <utility>. Patch contributed by Jonathan Sauer.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@153968 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant 2012-04-03 21:09:48 +00:00
parent 271a1c03c3
commit 2a5349ba66
2 changed files with 7 additions and 2 deletions

View File

@ -206,8 +206,11 @@ move_if_noexcept(_Tp& __x) _NOEXCEPT
}
struct _LIBCPP_VISIBLE piecewise_construct_t { };
//constexpr
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
#else
constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
template <class _T1, class _T2>
struct _LIBCPP_VISIBLE pair
@ -221,7 +224,7 @@ struct _LIBCPP_VISIBLE pair
// pair(const pair&) = default;
// pair(pair&&) = default;
_LIBCPP_INLINE_VISIBILITY pair() : first(), second() {}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() : first(), second() {}
_LIBCPP_INLINE_VISIBILITY pair(const _T1& __x, const _T2& __y)
: first(__x), second(__y) {}

View File

@ -11,6 +11,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
const piecewise_construct_t piecewise_construct = {};
#endif
_LIBCPP_END_NAMESPACE_STD