"Terje Slettebų" <[EMAIL PROTECTED]> wrote in message
05e001c2c7b8$ebb14b50$cb6c6f50@pc">news:05e001c2c7b8$ebb14b50$cb6c6f50@pc...
>
> template<typename B, typename D>
> struct helper
> {
>     template<typename T>
>     static char check(D const volatile &, T);
>     static char (& check(B const volatile &, int))[2];
>
>     struct C
>     {
>         operator B const volatile &() const;
>         operator D const volatile &();
>     };
>
>     static C getC();
> };
>
> template<typename B, typename D>
> struct is_base_and_derived
> {
>     static const bool result =
>         sizeof(helper<B,D>::check(helper<B,D>::getC(), 0)) == 1;
> };
>
> // If strict interpretation, i.e. not its own base class
>
> template<typename T>
> struct is_base_and_derived<T, T>
> {
>     static const bool result = false;
> };
>

Ironically this specialization has the same behavior as the primary
template.



Rani





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to