If an object construction fails, throw an exception.
The alternative is awful. You would have to create a flag if the construction succeeded, and check it in every method.
More Related Contents:
- some problems about c++ try catch [closed]
- c++ push reference node to stl list
- expected unqualified-id before 'public' [closed]
- c++ skipping the if and for loops?
- unsigned char* values to hexadecimal [duplicate]
- What does T&& (double ampersand) mean in C++11?
- No matching function – ifstream open()
- Are Exceptions in C++ really slow
- C++ Get name of type in template
- When using C headers in C++, should we use functions from std:: or the global namespace?
- order of evaluation of operands
- Is it possible to get the function pointer of a built-in standard operator?
- Read a file backwards?
- Is it legal to redefine a C++ keyword?
- map set/get requests into C++ class/structure changes
- Iterate through a C++ Vector using a ‘for’ loop
- Naming Include Guards
- C++/Win32: How to wait for a pending delete to complete
- How can I use Standard Library (STL) classes in my dll interface or ABI?
- Math precision requirements of C and C++ standard
- Do I need an extern “C” block to include standard POSIX C headers?
- C++ OpenCV image sending through socket
- C++ floating point to integer type conversions
- How to embed WebKit into my C/C++/Win32 application?
- How to easily indent output to ofstream?
- EnumDisplayDevices vs WMI Win32_DesktopMonitor, how to detect active monitors?
- returning an abstract class from a function
- How to Run Only One Instance of Application
- Is substitution performed on a variadic parameter pack type if the pack is empty?
- __attribute__((format(printf, 1, 2))) for MSVC?