Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2002-12-17 11:54:27

Howard Hinnant wrote:
> On Tuesday, December 17, 2002, at 09:59 AM, Rani Sharoni wrote:
> > In the same fashion - I think that if type is not cv void, not
> > reference and
> > not convertible to bool (via standard conversion) then it's class type.
> > It might be useful implementation for compliers on which the SFIAE
> > technique
> > to detect class type doesn't work.
> Would you not also have to test for not union?

It might be useful to distinguish classes into unions and non-unions,
but the standard clearly says that a union *is* a class (9/1). It seems
that it makes sense to detect unions, but AFAIK it's not possible to do
this automatically. It requires the user to tell us about all unions,
which is dangerous if we rely on the detection of unions. Maybe we
should go for this way:

- is_class detects classes, structs and unions automatically
- is_union detects unions with the help from the user

If you really need a 'real class' or struct, you test for (is_class &&
!is_union). Or we could create another helpers like is_non_union.

Regards, Daniel

Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web:

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