forked from boostorg/type_traits
Add enable_if_ and enable_if_t. Sever dependency on Core.
This commit is contained in:
1 parent
7639c5820b
commit
2baafd4a3a
9 files changed
+183
-8
No files matched your search
@@ -24,6 +24,7 @@
|
||||
#include <boost/type_traits/copy_cv.hpp>
|
||||
#include <boost/type_traits/decay.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/enable_if.hpp>
|
||||
#include <boost/type_traits/extent.hpp>
|
||||
#include <boost/type_traits/floating_point_promotion.hpp>
|
||||
#include <boost/type_traits/function_traits.hpp>
|
||||
|
||||
@@ -30,7 +30,7 @@ struct is_likely_stateless_lambda : public false_type {};
|
||||
#elif !defined(BOOST_NO_CXX11_LAMBDAS) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900)
|
||||
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/type_traits/enable_if.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
@@ -70,7 +70,7 @@ struct is_likely_stateless_lambda : false_type{};
|
||||
template<typename T>
|
||||
struct is_likely_stateless_lambda<
|
||||
T,
|
||||
typename boost::enable_if_c<has_one_operator_call<T>::value>::type> :
|
||||
typename boost::enable_if_<has_one_operator_call<T>::value>::type> :
|
||||
boost::is_convertible<T, typename equivalent_function_pointer<T>::type
|
||||
>{};
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
Copyright 2003 The Trustees of Indiana University
|
||||
|
||||
Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
|
||||
Jeremiah Willcock (jewillco at osl.iu.edu)
|
||||
Andrew Lumsdaine (lums at osl.iu.edu)
|
||||
|
||||
Copyright 2018 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
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)
|
||||
*/
|
||||
#ifndef BOOST_TT_ENABLE_IF_HPP_INCLUDED
|
||||
#define BOOST_TT_ENABLE_IF_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<bool B, class T = void>
|
||||
struct enable_if_ {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct enable_if_<false, T> { };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
template<bool B, class T = void>
|
||||
using enable_if_t = typename enable_if_<B, T>::type;
|
||||
#endif
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <boost/type_traits/has_nothrow_assign.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/enable_if.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/is_complete.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
@@ -48,7 +48,7 @@ struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_type {};
|
||||
template <class T>
|
||||
struct false_or_cpp11_noexcept_move_assignable <
|
||||
T,
|
||||
typename ::boost::enable_if_c<sizeof(T) && BOOST_NOEXCEPT_EXPR(::boost::declval<T&>() = ::boost::declval<T>())>::type
|
||||
typename ::boost::enable_if_<sizeof(T) && BOOST_NOEXCEPT_EXPR(::boost::declval<T&>() = ::boost::declval<T>())>::type
|
||||
> : public ::boost::integral_constant<bool, BOOST_NOEXCEPT_EXPR(::boost::declval<T&>() = ::boost::declval<T>())>
|
||||
{};
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ template <class T> struct is_nothrow_move_constructible<const volatile T> : publ
|
||||
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
|
||||
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/enable_if.hpp>
|
||||
|
||||
namespace boost{ namespace detail{
|
||||
|
||||
@@ -45,7 +45,7 @@ struct false_or_cpp11_noexcept_move_constructible: public ::boost::false_type {}
|
||||
template <class T>
|
||||
struct false_or_cpp11_noexcept_move_constructible <
|
||||
T,
|
||||
typename ::boost::enable_if_c<sizeof(T) && BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>()))>::type
|
||||
typename ::boost::enable_if_<sizeof(T) && BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>()))>::type
|
||||
> : public ::boost::integral_constant<bool, BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>()))>
|
||||
{};
|
||||
|
||||
|
||||
Reference in new issue
Block a user