Boost logo

Boost :

From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2002-10-27 22:58:46


Aleksey Gurtovoy <agurtovoy_at_[hidden]> writes:

| Beman Dawes wrote:
| [mailto:bdawes_at_[hidden]]
| > Sent: Sunday, October 27, 2002 9:29 PM
| > To: Boost mailing list; 'Boost mailing list'
| > Subject: RE: [boost] is_polymorphic added to type traits
| >
| >
| > At 03:01 AM 10/27/02, Aleksey Gurtovoy wrote:
| > >Beman Dawes wrote:
| > >> By the way, several compiler writers say they are implementing
| > >> support for type traits as they near standardization. One
| > >> compiler writer said he was doing it by adding built-in functions
| > >> with leading underscores (I guess like "__is_pod(...)").
| > >
| > >I hope these would be *meta*-functions, i.e.
| > >
| > > template< typename T > struct __is_pod { /* ...
| > 'type/value' members */
| >
| > >};
| >
| > No, it is only an attempt to introduce what is required to
| > support John's Type Traits proposal.
|
| Oh, you mean they are introducing ordinary functions to allow one to write
| something like this:

The way I'm intending to implement compiler support for type traits in
GCC is to have "built-in" operators like __builtin_xxx() (xxx ranging
over is_pod, has_trivial_copy_ctor, has_trivial_dtor, ...) to take a
type-id and return boolean constant expression.

Therefore,

| template< typename T > struct is_pod
| {
| BOOST_STATIC_CONSTANT(bool, value =

will be written

          BOOST_STATIC_CONSTANT(bool, value = __builtin_is_pod(T))

[ FWIW, I implemented the static-assert support in GCC at Santa Cruz,
  just after reporting (Robert, Judy and me) on the proposal.
  It isn't yet in FSF official source ]

-- Gaby


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