|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
The stream of the message of a macro that throws. More...
#include <ah-errors.H>
Public Member Functions | |
| Message_Stream (const char *file, const int line) | |
| Makes the stream and writes in it the place of the error. | |
| ~Message_Stream () | |
| Frees the stream. | |
| Message_Stream (const Message_Stream &)=delete | |
| A message has one stream: it is not copied. | |
| Message_Stream & | operator= (const Message_Stream &)=delete |
| A message has one stream: it is not assigned. | |
| std::ostringstream && | stream () noexcept |
| The stream, as the temporary stream of a macro was. | |
Private Attributes | |
| std::ostringstream * | stream_ = nullptr |
The stream of the message of a macro that throws.
A macro wrote its message in a temporary std::ostringstream, which lived in the frame of the function that checks: 376 bytes with libstdc++ on x86-64, and GCC does not inline a function whose frame grows so. This object owns the stream out of that frame, of which it takes a pointer, and frees it when the full expression of the macro ends, which is when its exception leaves.
stream() gives the stream as the temporary was, an rvalue of the same type: the items of a macro are written by the same insertions, at the same time and with the same types as before. The place of the error is written here, by the inserters of the standard library and before any item is evaluated.
Definition at line 170 of file ah-errors.H.
|
inline |
Makes the stream and writes in it the place of the error.
| [in] | file | The file of the call, as __FILE__ gives it. |
| [in] | line | The line of the call. |
| std::bad_alloc | If there is no memory for the stream; the macro has not evaluated any of its items then. |
Definition at line 181 of file ah-errors.H.
|
inline |
|
delete |
A message has one stream: it is not copied.
|
delete |
A message has one stream: it is not assigned.
|
inlinenoexcept |
The stream, as the temporary stream of a macro was.
Definition at line 207 of file ah-errors.H.
|
private |
Definition at line 172 of file ah-errors.H.
Referenced by Message_Stream(), and ~Message_Stream().