mirror of
https://github.com/boostorg/system.git
synced 2025-07-31 04:57:13 +02:00
Extract enable_if into its own header
This commit is contained in:
32
include/boost/system/detail/enable_if.hpp
Normal file
32
include/boost/system/detail/enable_if.hpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#ifndef BOOST_SYSTEM_DETAIL_ENABLE_IF_HPP_INCLUDED
|
||||||
|
#define BOOST_SYSTEM_DETAIL_ENABLE_IF_HPP_INCLUDED
|
||||||
|
|
||||||
|
// Copyright 2020 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace system
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
template<bool C, class T = void> struct enable_if
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct enable_if<false, T>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
} // namespace system
|
||||||
|
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif // #ifndef BOOST_SYSTEM_DETAIL_ENABLE_IF_HPP_INCLUDED
|
@ -16,6 +16,7 @@
|
|||||||
#include <boost/system/detail/error_category.hpp>
|
#include <boost/system/detail/error_category.hpp>
|
||||||
#include <boost/system/detail/generic_category.hpp>
|
#include <boost/system/detail/generic_category.hpp>
|
||||||
#include <boost/system/detail/system_category.hpp>
|
#include <boost/system/detail/system_category.hpp>
|
||||||
|
#include <boost/system/detail/enable_if.hpp>
|
||||||
#include <boost/system/api_config.hpp>
|
#include <boost/system/api_config.hpp>
|
||||||
#include <boost/system/detail/config.hpp>
|
#include <boost/system/detail/config.hpp>
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
@ -108,20 +109,9 @@ static const error_category & native_ecat BOOST_ATTRIBUTE_UNUSED = system_catego
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// enable_if
|
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
template<bool C, class T = void> struct enable_if
|
|
||||||
{
|
|
||||||
typedef T type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T> struct enable_if<false, T>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// failed_impl
|
// failed_impl
|
||||||
|
|
||||||
#if !defined(BOOST_SYSTEM_HAS_CONSTEXPR)
|
#if !defined(BOOST_SYSTEM_HAS_CONSTEXPR)
|
||||||
|
Reference in New Issue
Block a user