Boost logo

Boost Users :

From: Cory Nelson (phrosty_at_[hidden])
Date: 2006-02-09 21:39:52


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 list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net