simstr 1.5.0
Yet another strings library
 
Loading...
Searching...
No Matches
simstr::expr_replaced_e< K, E > Struct Template Reference

A string expression that generates a string replacing all occurrences of the given substring to string expression. More...

#include <strexpr.h>

Inheritance diagram for simstr::expr_replaced_e< K, E >:
simstr::expr_to_std_string< expr_replaced_e< K, E > >

Public Member Functions

constexpr expr_replaced_e (str_src< K > w, str_src< K > p, const E &e)
 Constructor.
 

Detailed Description

template<typename K, StrExprForType< K > E>
struct simstr::expr_replaced_e< K, E >

A string expression that generates a string replacing all occurrences of the given substring to string expression.

Template Parameters
K- string type.

If the search substring is not found, the string expression is not even evaluated. Then, when performing a replacement, the string expression is evaluated only once at the first replacement location, and characters from the first location are simply copied to subsequent replacement locations. This saves memory and time if you need to replace with some kind of "composite" string.

Constructor & Destructor Documentation

◆ expr_replaced_e()

template<typename K, StrExprForType< K > E>
simstr::expr_replaced_e< K, E >::expr_replaced_e ( str_src< K > w,
str_src< K > p,
const E & e )
inlineconstexpr

Constructor.

Parameters
w- source string.
p- the searched substring.
e- string expression to replace.

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