mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
Remove traits detection mechanism
This commit is contained in:
@ -844,78 +844,6 @@ namespace boost {
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// TRAITS TYPE DETECTION MECHANISM
|
||||
//
|
||||
// Used to implement traits that use a type if present, or a
|
||||
// default otherwise.
|
||||
|
||||
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1400
|
||||
|
||||
#define BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(tname) \
|
||||
template <typename Tp, typename Default> struct default_type_##tname \
|
||||
{ \
|
||||
\
|
||||
template <typename X> \
|
||||
static choice1::type test(choice1, typename X::tname* = 0); \
|
||||
\
|
||||
template <typename X> static choice2::type test(choice2, void* = 0); \
|
||||
\
|
||||
struct DefaultWrap \
|
||||
{ \
|
||||
typedef Default tname; \
|
||||
}; \
|
||||
\
|
||||
enum \
|
||||
{ \
|
||||
value = (1 == sizeof(test<Tp>(choose()))) \
|
||||
}; \
|
||||
\
|
||||
typedef typename boost::detail::if_true<value>::BOOST_NESTED_TEMPLATE \
|
||||
then<Tp, DefaultWrap>::type::tname type; \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
namespace boost {
|
||||
namespace unordered {
|
||||
namespace detail {
|
||||
template <typename T, typename T2> struct sfinae : T2
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(tname) \
|
||||
template <typename Tp, typename Default> struct default_type_##tname \
|
||||
{ \
|
||||
\
|
||||
template <typename X> \
|
||||
static typename boost::unordered::detail::sfinae<typename X::tname, \
|
||||
choice1>::type test(choice1); \
|
||||
\
|
||||
template <typename X> static choice2::type test(choice2); \
|
||||
\
|
||||
struct DefaultWrap \
|
||||
{ \
|
||||
typedef Default tname; \
|
||||
}; \
|
||||
\
|
||||
enum \
|
||||
{ \
|
||||
value = (1 == sizeof(test<Tp>(choose()))) \
|
||||
}; \
|
||||
\
|
||||
typedef typename boost::detail::if_true<value>::BOOST_NESTED_TEMPLATE \
|
||||
then<Tp, DefaultWrap>::type::tname type; \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define BOOST_UNORDERED_DEFAULT_TYPE(T, tname, arg) \
|
||||
typename default_type_##tname<T, arg>::type
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Allocator traits
|
||||
|
Reference in New Issue
Block a user