[libcxx] r185856 - Implement n3545 for c++14

Marshall Clow mclow.lists at gmail.com
Mon Jul 8 13:05:31 PDT 2013


Author: marshall
Date: Mon Jul  8 15:05:31 2013
New Revision: 185856

URL: http://llvm.org/viewvc/llvm-project?rev=185856&view=rev
Log:
Implement n3545 for c++14

Modified:
    libcxx/trunk/include/type_traits
    libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp

Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=185856&r1=185855&r2=185856&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Mon Jul  8 15:05:31 2013
@@ -236,6 +236,10 @@ struct _LIBCPP_TYPE_VIS integral_constan
     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 <class _Tp, _Tp __v>

Modified: libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp?rev=185856&r1=185855&r2=185856&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp Mon Jul  8 15:05:31 2013
@@ -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<std::false_type::value_type, bool>::value), "");
     static_assert((std::is_same<std::false_type::type, std::false_type>::value), "");





More information about the cfe-commits mailing list