|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2006-07-23 16:10:34
On 7/22/06, Kim Barrett <kab_at_[hidden]> wrote:
> At 12:10 PM -0400 7/22/06, Beman Dawes wrote:
> >* Addition of a header boost/identifier.hpp. For years I've used a
> >similar class to provide the type safety and freedom from unwanted
> >conversions that is missing when a simple int is used for an identifier.
> >This is logically separate from the system stuff, but for convenience is
> >included in the system package since error_code.hpp uses it.
>
> This appears to be very similar in intent to the facility provided by
> boost/strong_typedef.hpp, though there are significant differences in
> detail.
The intents of identifier.hpp and strong_typedef differ. A strong
typedef retains all operations on the underlying type in the new type.
An identifier only provides a very limited set of operations on the
new type. That is so an operation like multiplication of an
identifier, which is almost certainly an error, is not permitted and
will be detected by the complier.
It wouldn't surprise me if Boost has identifier.hpp functionality
somewhere, but I'm not aware of anything.
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk