Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-12-05 14:52:41


"Jon Kalb" <jonkalb_at_[hidden]> wrote in message
news:1BF6E16701F67A459A4D199880AF910301FA2770_at_svc-msg-01.northamerica.corp.m
icrosoft.com...
> [...]
> Vandevoorde and Josuttis call it SFINAE, "substitution failute is not an
> error."

Ah, I've heard of this, but didn't realize what it was all about.

> In "C++ Templates: The Complete Guide" (Recommended), they give
> this example on pages 106-107:
>
> typedef char RT1;
> typedef struct {char a[2];} RT2;
> template<typename T> RT1 test(typename T::X const*);
> template<typename T> RT2 test(...);
>
> #define type_has_member_type_X(T) \
> (sizeof(test<T>(0) == 1)

This is cool. What compilers are known to support it?

Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk