From d29bb4b7c4b97e7255856666f70f10dbeeb26beb Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 8 Jul 2013 20:05:31 +0000 Subject: [PATCH] Implement n3545 for c++14 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185856 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/type_traits | 4 ++++ test/utilities/meta/meta.hel/integral_constant.pass.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/include/type_traits b/include/type_traits index 450b5928..dd84abf2 100644 --- a/include/type_traits +++ b/include/type_traits @@ -236,6 +236,10 @@ struct _LIBCPP_TYPE_VIS integral_constant typedef integral_constant type; _LIBCPP_INLINE_VISIBILITY _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 diff --git a/test/utilities/meta/meta.hel/integral_constant.pass.cpp b/test/utilities/meta/meta.hel/integral_constant.pass.cpp index 7f9e2769..92d13c55 100644 --- a/test/utilities/meta/meta.hel/integral_constant.pass.cpp +++ b/test/utilities/meta/meta.hel/integral_constant.pass.cpp @@ -26,6 +26,11 @@ int main() assert(_5() == 5); #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::is_same::value), ""); static_assert((std::is_same::value), "");