|
noexcept |
Constructs an exception object by a specified error code, and a description provided by an std::basic_string object. .
char_t | is a type of a symbol of an std::basic_string object specifying the description. |
traits_t | is a type of a character traits class that is used by the std::basic_string template. |
alloc_t | is a type of an allocator class used by the std::basic_string template. |
[in] | nCode | is a code to be associated with the constructed exception object. |
[in] | strDescriptionFormat | is an std::basic_string object specifying the description. Unlike other constructors, the current one performs neither tag nor Printf formatting. The string is set as the description of the exception "as-is". However, if the string is empty, the actual description set is a notification saying that the description is not specified. |
The constructor creates an instance of the ExceptionWithGenericCode<code_t>
class with associated error code and the description. The description is constructed without any formatting, performed by other constructors of the ExceptionWithGenericCode
class. For example, the following code
results in the exception description (with MSVC defined errno subsystem) to be :
Error <22>: Invalid argument
The same, except for a base used to represent the error code value, result can be achieved by using the another overload of ExceptionWithGenericCode, as follows:
or, using overload with tag formatting and Printf formatting, as follows:
{.cpp}
nullptr
in the place of the omitted functor.