-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a1f688
commit d855e3d
Showing
3 changed files
with
133 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// | ||
// detail/sfinae_helpers.hpp | ||
// ~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
// | ||
// Copyright (c) 2019 Alexander Karzhenkov | ||
// | ||
// 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 ASIO_DETAIL_SFINAE_HELPERS_HPP | ||
#define ASIO_DETAIL_SFINAE_HELPERS_HPP | ||
|
||
#if defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
# pragma once | ||
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
|
||
#include "asio/detail/config.hpp" | ||
#include "asio/detail/type_traits.hpp" | ||
|
||
#include "asio/detail/push_options.hpp" | ||
|
||
namespace asio { | ||
namespace detail { | ||
|
||
template <typename C> | ||
struct sfinae_result_helper : C | ||
{ | ||
using C::detector; | ||
|
||
template <typename> | ||
static char(&detector(...))[2]; | ||
}; | ||
|
||
template <typename C, typename T> | ||
struct sfinae_result | ||
: integral_constant<bool, | ||
sizeof(sfinae_result_helper<C>::template detector<T>(0)) == 1> | ||
{ | ||
}; | ||
|
||
template <typename C> | ||
struct sfinae_result<C, void> : false_type | ||
{ | ||
}; | ||
|
||
struct sfinae_check_base | ||
{ | ||
template <int N> struct result { }; | ||
|
||
template <typename T> | ||
static typename enable_if< | ||
is_member_function_pointer<T>::value>::type | ||
is_memfn(T); | ||
|
||
template <typename To, typename From> | ||
static typename enable_if< | ||
is_convertible<From, To>::value>::type | ||
is_convertible_to(From); | ||
|
||
template <typename T> | ||
static void check(); | ||
}; | ||
|
||
} // namespace detail | ||
} // namespace asio | ||
|
||
#include "asio/detail/pop_options.hpp" | ||
|
||
#endif // ASIO_DETAIL_SFINAE_HELPERS_HPP |
Oops, something went wrong.