I know RAII and was trying to stick to single step instantiation. As long as all arguments for members are given, instance is valid, and it destruct at destructor.
However, if the class is big enough to store multiple structs, constructor soon have too many arguments. Also, if a class has dependent instantiation such as LoadFromXXX or InitializeFromXXX type of function, having 2 step instantiation seems the best option to me. Especially, if the class instance is member of other class (not as pointer), constructor chain begins and all constructor arguments must be obtained. In other words, it is difficult to insert such operation as
Instance.LoadConfig(FilePath);
Instance.Create();
To me, it seems good workaround to cope with too many argument situation and delayed instantiation by applying somewhat similar to that of builder, while losing single step RAII. Release issue can be managed in destructor using if.
if (pAllocated)
delete pAllocated;
Or pAllocated->Release();
The only problem i can think of this method is that this opens partially valid instance or empty instance.
Is this unacceptably bad?