I want to implement a class with the following properties:
class A { ... };
const A a;
A b;
In addition, it would be better if the value of the constobject depends on the signature of the constructors:
const A c(1);
A d("a");
A e(2);
If necessary, the use of C ++ 11 is allowed.
Update # 1
Since I do not know the answer, it does not need to strictly follow the code above - any C ++ template that provides similar semantics is welcome.
source
share