multiple implicit constructors (MPL?)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

multiple implicit constructors (MPL?)

Cory Nelson
Hello,

I have a class, large_integer<BaseT>.  I build 256bit integers by doing:

typedef large_integer<unsigned long long> uint128;
typedef large_integer<uint128> uint256;

Unfortunately C++ only seems to allow one implicit conversion, so I'm
unable to do uint256 a = 0, and have to do uint256 a = uint128(0);
instead.

I'm able to get around one of these by having a constructor which
takes the base type, but that only gets me one free conversion,
meaning a uint512 has the same issue.

Is there a way around this (I'm guessing MPL would be my best bet?)?

--
Cory Nelson
http://www.int64.org

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users