|
Panini 1.4.0
Header-only library for generating C++, written in C++17
|
Command for outputting a label statement. More...
#include <Label.hpp>
Public Member Functions | |
| Label (const std::string &name) | |
| Label (std::string &&name) noexcept | |
| void | Visit (Writer &writer) override |
Public Member Functions inherited from panini::Command | |
| virtual | ~Command ()=default |
Command for outputting a label statement.
A label is a name and a ":" chunk. The command pops the indentation before writing the label and restores it afterwards.
Labels are useful when you don't want to modify the current indentation level, e.g. when writing an access identifier for a class or a switch..case statement.
Example:
Output:
|
inlineexplicit |
Create a Label command with a name that is copied to the instance.
|
inlineexplicitnoexcept |
Create a Label command with a name that is moved into the instance.
|
inlineoverridevirtual |
Accepts a Writer to write chunks to the output.
Implements panini::Command.