]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | #ifndef BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED |
2 | #define BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED | |
3 | ||
4 | // Copyright 2017 Peter Dimov | |
5 | // | |
6 | // Distributed under the Boost Software License, Version 1.0. | |
7 | // See accompanying file LICENSE_1_0.txt or copy at | |
8 | // http://www.boost.org/LICENSE_1_0.txt | |
9 | ||
10 | #include <boost/config.hpp> | |
11 | #include <boost/config/workaround.hpp> | |
12 | #include <boost/type_traits/integral_constant.hpp> | |
13 | #include <boost/type_traits/declval.hpp> | |
14 | #include <boost/type_traits/is_complete.hpp> | |
15 | #include <boost/static_assert.hpp> | |
16 | ||
17 | namespace boost | |
18 | { | |
19 | ||
20 | #if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_DECLTYPE) \ | |
21 | || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)\ | |
22 | || BOOST_WORKAROUND(BOOST_GCC, < 40700) | |
23 | ||
24 | template<class T, class = void, class = void, class = void, class = void, class = void, class = void> struct is_list_constructible: false_type | |
25 | { | |
26 | BOOST_STATIC_ASSERT_MSG(boost::is_complete<T>::value, "Arguments to is_list_constructible must be complete types"); | |
27 | }; | |
28 | ||
29 | #else | |
30 | ||
31 | namespace type_traits_detail | |
32 | { | |
33 | ||
34 | template<class T, class... A, class = decltype( T{declval<A>()...} )> true_type is_list_constructible_impl( int ); | |
35 | template<class T, class... A> false_type is_list_constructible_impl( ... ); | |
36 | ||
37 | } // namespace type_traits_detail | |
38 | ||
39 | template<class T, class... A> struct is_list_constructible: decltype( type_traits_detail::is_list_constructible_impl<T, A...>(0) ) | |
40 | { | |
41 | BOOST_STATIC_ASSERT_MSG(boost::is_complete<T>::value, "Arguments to is_list_constructible must be complete types"); | |
42 | }; | |
43 | ||
44 | #endif | |
45 | ||
46 | } // namespace boost | |
47 | ||
48 | #endif // #ifndef BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED |