2
0
mirror of https://github.com/boostorg/asio.git synced 2026-02-24 14:22:08 +00:00

Patch from Ticket #2372

[SVN r49155]
This commit is contained in:
Nicola Musatti
2008-10-06 21:46:14 +00:00
parent 7d25f1c393
commit 32da68bc8e

View File

@@ -30,11 +30,27 @@
#include <boost/asio/basic_streambuf.hpp>
#include <boost/asio/error.hpp>
#include <boost/detail/workaround.hpp>
namespace boost {
namespace asio {
namespace detail
{
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
template <typename T>
struct has_result_type
{
template <typename U> struct inner
{
struct big { char a[100]; };
static big helper(U, ...);
static char helper(U, typename U::result_type* = 0);
};
static const T& ref();
enum { value = (sizeof((inner<const T&>::helper)((ref)())) == 1) };
};
#else
template <typename T>
struct has_result_type
{
@@ -44,6 +60,7 @@ namespace detail
static const T& ref();
enum { value = (sizeof((helper)((ref)())) == 1) };
};
#endif
} // namespace detail
/// Type trait used to determine whether a type can be used as a match condition