Hi ,
I am reading some boost code now , and
I got confused by the following code in the
add_reference type trait .
template <class TT&(* is_reference_he lper1(wrap<T>) )(wrap<T>);
char is_reference_he lper1(...);
template <class Tno_type is_reference_he lper2(T&(*)(wra p<T>));
yes_type is_reference_he lper2(...);
template <typename T>
struct is_reference_im pl
{
BOOST_STATIC_CO NSTANT(
bool, value = sizeof(
::boost::detail ::is_reference_ helper2(
::boost::detail ::is_reference_ helper1(::boost ::type_traits:: wrap<T>())))
== 1
);
};
Why does function is_reference_he lper1 define in such
a way , I can't understand what is it !
Could someone explain these code for me ?
Thank you very much !
I am reading some boost code now , and
I got confused by the following code in the
add_reference type trait .
template <class TT&(* is_reference_he lper1(wrap<T>) )(wrap<T>);
char is_reference_he lper1(...);
template <class Tno_type is_reference_he lper2(T&(*)(wra p<T>));
yes_type is_reference_he lper2(...);
template <typename T>
struct is_reference_im pl
{
BOOST_STATIC_CO NSTANT(
bool, value = sizeof(
::boost::detail ::is_reference_ helper2(
::boost::detail ::is_reference_ helper1(::boost ::type_traits:: wrap<T>())))
== 1
);
};
Why does function is_reference_he lper1 define in such
a way , I can't understand what is it !
Could someone explain these code for me ?
Thank you very much !
Comment