This is a good question. In pletora C ++ types, options record safe patterns of this kind, like pain below.
template <typename T> struct FrameworkTemplate { T mInstance; };
Note that in theory, a user can instantiate your class template as
where the last three are not constructive by default, although it may be A. That's why useful general types like any , nullable , lazy , etc., although simple and intuitive at first glance, are not trivial to implement (safely) in C + + ...
Paul michalik
source share