Boost logo

Boost :

Subject: Re: [boost] Processor traits
From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2008-12-22 10:14:46


Antoine de Maricourt wrote:
> Hi,
>
> is there in boost a trait to describe current target capabilities,
> i.e. processor's available instruction set, size of registers (32, 64,
> ... bits) and any other usefull feature?

There isn't.

>
> To give an example, I'd like to write code like the following one,
> with different versions of the same function depending on target
> capabilities.

That isn't quite possible, since architecture-specific code would
contain bits (such as compiler intrinsics) that are only valid when
compiling for that target, using a specific compiler, yet there is no
mechanism for masking those bits in your demo code.
Usually this masking is achieved using the preprocessor. However, as it
is very hard to come up with a complete processor / capability taxonomy,
I doubt even there a generic and comprehensive set of macros exists.

Regards,
       Stefan

-- 
      ...ich hab' noch einen Koffer in Berlin...

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