Concatenation of strings and other types.
◆ cat() [1/6]
std::string gul14::cat |
( |
| ) |
|
|
inline |
Efficiently concatenate an arbitrary number of strings and numbers.
Numbers are converted to strings in the same way as done by std::to_string. cat() reserves the correct amount of space before concatenating the strings and can therefore save several memory allocations compared to concatenation with "+".
std::string str =
gul14::cat(13.5, std::string(
" quick "),
"brown foxes ",
"jump over ",
42, " lazy dogs'", std::string(" heads."));
std::string cat()
Efficiently concatenate an arbitrary number of strings and numbers.
Definition: cat.h:97
- Returns
- a string containing the concatenation of all arguments.
Referenced by gul14::SlidingBuffer< ElementT, fixed_capacity, Container >::at(), gul14::SmallVector< ElementT, in_capacity >::at(), and gul14::cat().
◆ cat() [2/6]
template<typename... Args, typename = std::enable_if_t<(sizeof...(Args) > 3)>>
std::string gul14::cat |
( |
const Args &... |
args | ) |
|
|
inline |
◆ cat() [3/6]
◆ cat() [4/6]
◆ cat() [5/6]
◆ cat() [6/6]