diff --git a/include/type_traits b/include/type_traits index 90ebfcd2..f4677358 100644 --- a/include/type_traits +++ b/include/type_traits @@ -197,7 +197,9 @@ namespace std template using result_of_t = typename result_of::type; // C++14 -} // std + template + using void_t = void; +} // C++17 */ #include <__config> @@ -209,6 +211,11 @@ namespace std _LIBCPP_BEGIN_NAMESPACE_STD +#ifndef _LIBCPP_HAS_NO_VARIADICS +template +struct __void_t { typedef void type; }; +#endif + template struct _LIBCPP_TYPE_VIS_ONLY conditional {typedef _If type;}; template @@ -3673,6 +3680,10 @@ struct __has_operator_addressof #endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE +#if _LIBCPP_STD_VER > 14 +template using void_t = void; +#endif + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_TYPE_TRAITS diff --git a/test/utilities/meta/meta.unary.prop.query/void_t.pass.cpp b/test/utilities/meta/meta.unary.prop.query/void_t.pass.cpp new file mode 100644 index 00000000..1f99a74d --- /dev/null +++ b/test/utilities/meta/meta.unary.prop.query/void_t.pass.cpp @@ -0,0 +1,69 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// void_t + +#include + +#if _LIBCPP_STD_VER <= 14 +int main () {} +#else + +template +void test1() +{ + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); +} + +template +void test2() +{ + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); + + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); + static_assert( std::is_same>::value, ""); +} + +class Class +{ +public: + ~Class(); +}; + +int main() +{ + static_assert( std::is_same>::value, ""); + + test1(); + test1(); + test1(); + test1(); + test1(); + test1(); + test1(); + + test2(); + test2(); + test2(); + test2(); + test2(); + + static_assert( std::is_same>::value, ""); +} +#endif diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index 383e2133..1429de0c 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -55,10 +55,10 @@ N4190LWGRemoving auto_ptr, random_shuffle(), And Old Stuff.Urbana N4284LWGContiguous Iterators.Urbana N4089LWGSafe conversions in unique_ptr<T[]>.Urbana - N4277LWGTriviallyCopyable reference_wrapper.Urbana + N4277LWGTriviallyCopyable reference_wrapper.UrbanaComplete3.2 N4258LWGCleaning-up noexcept in the Library.Urbana N4279LWGImproved insertion interface for unique-key maps.Urbana - N3911LWGTransformationTrait Alias void_t.Urbana + N3911LWGTransformationTrait Alias void_t.UrbanaComplete3.6 N4169LWGA proposal to add invoke function templateUrbana N4280LWGNon-member size() and moreUrbana @@ -83,16 +83,16 @@ 2106move_iterator wrapping iterators returning prvaluesUrbana - 2129User specializations of std::initializer_listUrbana - 2212tuple_size for const pair request headerUrbana + 2129User specializations of std::initializer_listUrbanaComplete + 2212tuple_size for const pair request headerUrbanaComplete 2217operator==(sub_match, string) slices on embedded '\0'sUrbana - 2233bad_function_call::what() unhelpfulUrbana + 2230"see below" for initializer_list constructors of unordered containersUrbanaComplete + 2233bad_function_call::what() unhelpfulUrbanaComplete 2266vector and deque have incorrect insert requirementsUrbana - 2325minmax_element() 's behavior differing from max_element()'s should be notedUrbana - 2230"see below" for initializer_list constructors of unordered containersUrbana + 2325minmax_element()'s behavior differing from max_element()'s should be notedUrbanaComplete 2361Apply 2299 resolution throughout libraryUrbana - 2365Missing noexcept in shared_ptr::shared_ptr(nullptr_t)Urbana - 2376bad_weak_ptr::what() overspecifiedUrbana + 2365Missing noexcept in shared_ptr::shared_ptr(nullptr_t)UrbanaComplete + 2376bad_weak_ptr::what() overspecifiedUrbanaComplete 2387More nested types that must be accessible and unambiguousUrbana -

Last Updated: 10-Nov-2014

+

Last Updated: 17-Nov-2014