Boost logo

Boost :

From: Vesa Karvonen (vesa.karvonen_at_[hidden])
Date: 2001-08-27 10:07:56


Several type traits currently require special support from the user or the
compiler. [I think that this is highly undesirable for several reasons.] These
traits include (with some special cases) at least:

    is_class
    is_enum
    is_union
    is_POD
    is_empty
    has_trivial_constructor
    has_trivial_copy
    has_trivial_assign
    has_trivial_destructor

In the case that a particular trait is not specialized, the current type
traits implementation typically return false, which can typically be
considered safe.

However, in some cases, the user may really want to know the real answer and
is willing to write the specializations whenever an unknown type is found.
Perhaps the user makes use of traits for specializing algorithms or
interfacing with other languages and likes to make sure that everything works
as intended.

Possible solutions:
- Core language support.

- Strict traits that would fail or return "probably_false" whenever they can
not make a definite answer:

    is_class_strict
    is_enum_strict
    is_union_strict
    is_POD_strict
    is_empty_strict
    has_trivial_constructor_strict
    has_trivial_copy_strict
    has_trivial_assign_strict
    has_trivial_destructor_strict

- Separately implemented negative traits, which can be cross checked with the
positive traits:

    is_not_class
    is_not_enum
    is_not_union
    is_not_POD
    is_not_empty
    has_no_trivial_constructor
    has_no_trivial_copy
    has_no_trivial_assign
    has_no_trivial_destructor


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