mirror of
https://github.com/yuzu-mirror/sirit.git
synced 2026-01-25 00:50:16 +01:00
By taking the std::string by value in the constructor, this allows for
certain situations where copies can be elided entirely (when moving an
instance into the constructor)
e.g.
std::string var = ...
...
... = LiteralString(std::move(var)) // Or whatever other initialization
// is done.
No copy will be done in this case, the move transfers it into the
constructor, and then the move within the initializer list transfers it
into the member variable.
tl;dr: This allows the calling code to potentially construct less
std::string instances by allowing moving into the parameters themselves.
|
||
|---|---|---|
| .. | ||
| instructions | ||
| .gitignore | ||
| CMakeLists.txt | ||
| common_types.h | ||
| literal_number.cpp | ||
| literal_number.h | ||
| literal_string.cpp | ||
| literal_string.h | ||
| op.cpp | ||
| op.h | ||
| operand.cpp | ||
| operand.h | ||
| sirit.cpp | ||
| stream.cpp | ||
| stream.h | ||