22 template <
typename C>
static yep hasGetMethod (
decltype(&C::get) );
23 template <
typename C>
static nope hasGetMethod (...);
26 template <
typename C>
static yep hasPointerOperator(
decltype(&C::operator->) ) ;
27 template <
typename C>
static nope hasPointerOperator(...);
30 template <
typename C>
static typename C::iterator hasIterator(
int);
31 template <
typename>
static void hasIterator(...);
36 enum { is_smartptr =
sizeof(hasGetMethod<T>(0)) ==
sizeof(yep) };
37 enum { stl_smartptr = !std::is_void<decltype(hasPointerOperator<T>(0))>::value };
38 enum { stl_iterable = !std::is_void<decltype(hasIterator<T>(0))>::value };
51template<
class value_type>
52inline static typename std::enable_if<sparta_traits<value_type>::is_smartptr ==
false,
53 const value_type*>::type
69template<
class value_type>
70inline static typename std::enable_if<sparta_traits<value_type>::is_smartptr ==
true,
71 const typename value_type::element_type*>::type
static std::enable_if< sparta_traits< value_type >::is_smartptr==false, constvalue_type * >::type getAsPointer(const value_type &obj)
getAsPointer Intended to convert what object is given to a pointer type