Boost logo

Boost :

Subject: [boost] Boost.Conversion - pre review request
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-07-06 19:23:16


I've been reworking the Boost.Conversion library

Sandbox :

Boost.Conversion manages with generic extrinsic conversion between unrelated
types. These conversion can be seen as implicit or explicit conversions.

The conversion operator can not be overloaded with a free function on C++.
In the past, there were some request to been able to overload the @c
static_cast operator []. The author thinks that the language would be more
uniform if this extrinsic overload would be possible. The new operators
could take the following form

operator Target(const Source& val);

explicit operator Target(const Source& val);

The assignment operator could also be overloaded by a free function with
some limitations as described in []

Target& operator=(Target&, Source const&);

Boost.Conversion tries to provide a library emulation for this missing
feature and shows some needed workarounds that are needed to take care of
the current C++ semantics.

In order to provide the needed functionality, two type traits are mandatory
is_constructible and is_assignable. The library provide a first
implementation of these type traits that works on compilers providing some
specific features. The idea is that these type traits should be added to
John, Joel I would like we work together to have these traits available in
as many compilers as we can.
When we don't have an automatic way to detect these traits, the library
provide specialization for some std and boost types. If you agree the
library could provide the specializations for all the standard types and
optionally for some Boost types.

User working with compilers not supporting the definition of these traits,
or users that need to make their code portable, will need to specialize
these traits by hand for his types.
The review dates are 20th to 29th August. I would like to have some feedback
before the review so I can have some time to make the library review ready.


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at