Extract enable_if into its own header

This commit is contained in:
Peter Dimov
2020-08-27 01:21:56 +03:00
parent d581eb203e
commit 72ea1ef846
2 changed files with 33 additions and 11 deletions

View 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

View File

@ -16,6 +16,7 @@
#include <boost/system/detail/error_category.hpp>
#include <boost/system/detail/generic_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/detail/config.hpp>
#include <boost/cstdint.hpp>
@ -108,20 +109,9 @@ static const error_category & native_ecat BOOST_ATTRIBUTE_UNUSED = system_catego
#endif
// enable_if
namespace detail
{
template<bool C, class T = void> struct enable_if
{
typedef T type;
};
template<class T> struct enable_if<false, T>
{
};
// failed_impl
#if !defined(BOOST_SYSTEM_HAS_CONSTEXPR)