I want simple C++ string based template library to replace strings at runtime.
For example, I will use
string template = \"My name is {{name}}\";
>
Have you considered a set of inline functions that use ostringstram instead of "string templates"?
inline std::string name_template(const std::string& name)
{
std::ostringstream os;
os << "My name is " << name;
return os.str();
}
There are other alternate approaches if you need more generality. For example a class hierarchy where the base provides a "format" interface and child classes implement it with the appropriate varying implementation.