I have a class named NumBase
, and I want to initialize the objects of that class with a special customization, like shown below:
NumBase<8> Num1 = 2312347;
NumBase<10> Num2 = 23123479;
NumBase<16> Num3 = 23F13A47;
NumBase<12> Num4 = 2312A47;
Is there any way to initialize exact like this way?
Or
NumBase(8) Num1 = 2312347;
NumBase(10) Num2 = 23123479;
NumBase(16) Num3 = 23F13A47;
NumBase(12) Num4 = 2312A47;
also
NumBase<8> Num1(2312347);
NumBase<10> Num2(23123479);
NumBase<16> Num3(23F13A47);
NumBase<12> Num4(2312A47);
but not like this:
NumBase<16> Num3("23F13A47");
or
NumBase<16> Num3 = "23F13A47" ;
In other words, I don't want to use strings.
If it is possible, how can I do it?