forked from boostorg/type_traits
Add is_list_constructible
This commit is contained in:
1 parent
64421a443b
commit
ced4870cb0
6 files changed
+165
No files matched your search
@@ -107,6 +107,7 @@
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/type_traits/is_fundamental.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_list_constructible.hpp>
|
||||
#include <boost/type_traits/is_lvalue_reference.hpp>
|
||||
#include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
#include <boost/type_traits/is_member_object_pointer.hpp>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
#define BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
|
||||
// Copyright 2017 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
|
||||
template<class T, class = void, class = void, class = void, class = void, class = void, class = void> struct is_list_constructible: false_type
|
||||
{
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
namespace type_traits_detail
|
||||
{
|
||||
|
||||
template<class T, class... A, class = decltype( T{declval<A>()...} )> true_type is_list_constructible_impl( int );
|
||||
template<class T, class... A> false_type is_list_constructible_impl( ... );
|
||||
|
||||
} // namespace type_traits_detail
|
||||
|
||||
template<class T, class... A> struct is_list_constructible: decltype( type_traits_detail::is_list_constructible_impl<T, A...>(0) )
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_IS_LIST_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
Reference in new issue
Block a user