Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 1999-11-29 23:51:22


scleary_at_[hidden] writes:
> In order to easily allow compiler extensions, I finally separated the list
> of valid types out into a structure, which satisfies "Platform"
> requirements. I ended up requiring "Platform" to have two "compile-time
> doubly-linked lists", one for signed and one for unsigned integers. (Please
> note that this is still fairly hacked). I also ended up writing a
> compile-time generic algorithm - the "find" algorithm, and also wrote
> requirements for compile-time predicates, compile-time iterators, and
> compile-time bidirectional iterators.
>
> When this level of genericity (is that a word? :) had been reached, I simply
> have my "bit_int" class find an integer of the correct sign that had at
> least a certain number of bits. The int choosers also become almost
> trivial, just declaring a proper predicate and using the compile-time find
> to "return" the correct type.
>

I've also found STL-ish compile time constructs to be useful, such as
compile time transform and accumulate operations. I'll enjoy reading
through your approach on the find function.

I've seen two flavors of compile-time operations that can be
useful. One which computes the result at compile-time, the other in
which the length and types (possibly heterogeneous) are determined at
compile-time, but the values are still detemined at run-time.

Ciao,

Jeremy


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