0

For example, I can do this :

uint64_t a = 100;
BigInteger b = a;

But I can't do this :

BigInteger a = 100;
uint64_t b = a;

Is there any way? Thanks.

2 Answers2

1

Problem solved!

operator uint64_t() {return get_integer();}

Thanks for your help.

1

The simplest solution is to make BigInteger implicitly convertible to uint64_t. This can be achieved with a conversion operator:

BigInteger::operator uint64_t();
eerorika
  • 232,697
  • 12
  • 197
  • 326