我基于具有固定编译大小的数组构造了一个类整数,(它真的看起来像 c11 std::array)。我正在寻找基于数组意识形态的新构造函数。我是说
integer<128> = {64-bit number, 64-bit number};
// as
int a[2] = {1,1};
好吧,我必须重载 operator= 之类的东西
template<int NumBits>
class integer{
typedef boost::uint64_t value_type;
static const std::size_t numwords = (NumBits+63)/64;
value_type& operator[](size_type i);
const value_type& operator[](size_type i) const;
integer & operator= ("What do I write {...}"){
container[0] = ????
container[1] = ????
.................
}
value_type container[numwords];
};