Implement n3545 for c++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185856 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0769e6a785
commit
d29bb4b7c4
@ -236,6 +236,10 @@ struct _LIBCPP_TYPE_VIS integral_constant
|
|||||||
typedef integral_constant type;
|
typedef integral_constant type;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_CONSTEXPR operator value_type() const {return value;}
|
_LIBCPP_CONSTEXPR operator value_type() const {return value;}
|
||||||
|
#if _LIBCPP_STD_VER > 11
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
constexpr value_type operator ()() const {return value;}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, _Tp __v>
|
template <class _Tp, _Tp __v>
|
||||||
|
@ -26,6 +26,11 @@ int main()
|
|||||||
assert(_5() == 5);
|
assert(_5() == 5);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if _LIBCPP_STD_VER > 11
|
||||||
|
static_assert ( _5{}() == 5, "" );
|
||||||
|
static_assert ( std::true_type{}(), "" );
|
||||||
|
#endif
|
||||||
|
|
||||||
static_assert(std::false_type::value == false, "");
|
static_assert(std::false_type::value == false, "");
|
||||||
static_assert((std::is_same<std::false_type::value_type, bool>::value), "");
|
static_assert((std::is_same<std::false_type::value_type, bool>::value), "");
|
||||||
static_assert((std::is_same<std::false_type::type, std::false_type>::value), "");
|
static_assert((std::is_same<std::false_type::type, std::false_type>::value), "");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user