Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-10-28 01:42:54


Gabriel Dos Reis wrote:
> | Interesting! But wouldn't it be easier just to drop
> |
> | template<typename X> __yes_type __builtin_is_pod();
> |
> | into the global scope when X is defined/instantiated for
> the first time (if
> | it's a template class)?
>
> Actually, it is easier the other way (i.e. as an operator) -- it just
> took me about few minutes before embarking on valarray issues on
> Wednesday morning :-)

Oh, if the operators are that easy to implement, then I guess it makes
perfect sense to stick to them. Thanks for the explanation!

> If implemented as a function template, I would have to keep track of
> every template instantiation.

For some reason I assumed that the compiler already does that :).

[...]

> | After all, there isn't much of a difference between
> |
> | BOOST_STATIC_CONSTANT(bool, value = __builtin_is_pod(T))
> |
> | and
> | BOOST_STATIC_CONSTANT(bool, value =
> sizeof(__builtin_is_pod<T>())
>
> much difference in terms of what? The second is waste of time and
> memory; it will be implemented in terms of the former.

I meant "there isn't much of a difference from user's standpoint".

[...]

> Well, I implemented the proposed feature (with the expression syntax)
> because Robert and I have been discussing some points and also I
> really wanted to know how useful it really is (compared to other
> approaches). I hope to have it in the FSF official source as soon as
> possible. I will drop a note here for testing as soon as it is in

Looking forward to it!

> (unless you're impatient and want to test it now, in which case I can
> send you a patch against GCC experimental source).

I would be happy to accept the offer, but as some other people on this list,
I am kind of swamped at the moment. Thanks anyway!

Aleksey


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