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
> [...]
> 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?


Boost list run by bdawes at, gregod at, cpdaniel at, john at