simstr 1.7.3
Yet another strings library
 
Loading...
Searching...
No Matches
simstr::e_concat< K, G, Arg, Args > Struct Template Reference

String expression concatenating the specified string expressions using the specified delimiter. More...

#include <strexpr.h>

Inheritance diagram for simstr::e_concat< K, G, Arg, Args >:
simstr::expr_to_std_string< e_concat< K, G, Arg, Args... > >

Public Member Functions

constexpr e_concat (G &&glue, Arg &&arg, Args &&...args)
 Create a string expression concatenating the specified string expressions using the specified delimiter.
 

Detailed Description

template<typename K, typename G, typename Arg, typename... Args>
struct simstr::e_concat< K, G, Arg, Args >

String expression concatenating the specified string expressions using the specified delimiter.

Template Parameters
K- character type, deduced from the separator type.

Constructor & Destructor Documentation

◆ e_concat()

template<typename K, typename G, typename Arg, typename... Args>
simstr::e_concat< K, G, Arg, Args >::e_concat ( G && glue,
Arg && arg,
Args &&... args )
inlineconstexpr

Create a string expression concatenating the specified string expressions using the specified delimiter.

Parameters
glue- the "glue" used when connecting arguments is inserted between them.
arg,args...- the arguments to be combined, at least two.

"Glues" the passed arguments, inserting the specified "glue" between them. The connector and arguments can be string literals, string expressions, standard strings. Arguments can also be any type for which there is a conversion to a string expression. (see Converting types to string expressions). For arguments that are themselves string expressions, e_concat stores only a reference to them. This is usually not a problem if the reference is not to a temporary object, or the string expression is materialized now, before ';'. If you need to return e_concat as a string expression from a function, you can force it to preserve string expression arguments over a copy by wrapping them in force_copy{}. See tests/test_tostrexpr.cpp, Method4 for an example. Example

std::string t = e_concat("", text, " = ", count, " times.");
....
std::string t = "msg=" + e_concat(", ", text1, text3, text3, count1, count2);
constexpr e_concat(G &&glue, Arg &&arg, Args &&...args)
Create a string expression concatenating the specified string expressions using the specified delimit...
Definition strexpr.h:6479

The documentation for this struct was generated from the following file: