Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-02-15 13:47:13


AMDG

Matthias Schabel <boost <at> schabel-family.org> writes:

> automatically. For example, on g++ gives :
>
> FN5boost5units10length_tagEvE
> FN5boost5units2SI6systemEvE
>
> for
>
> typeid(length_tag()).name()
> typeid(SI::system()).name()

There is no way to access this at compile time.

>
> If these could be hashed into a long int, that would be all we
> needed. Probably
> would involve very non-portable code, but it might be supportable on
> a few
> of the major compilers... I thought C++ name mangling was supposed to be
> standardized...

Hashing provides no guarantees against collisions.

struct system : ordinal<hash_typename<
    'b', 'o', 'o', 's', 't', ':', ':',
    'u', 'n', 'i', 't', 's', ':', ':',
    'S', 'I'>::value> {}

>
> Since no inter-system conversion happens in the operators, I think
> that's all that would
> happen. This will definitely not happen before the review, but I
> think it could be done
> and would be interesting...
>
> Matthias

You need it to represent kilowatt-hours, I believe.

In Christ,
Steven Watanabe


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