cpptempl 是一个 C++ 模板引擎。
模板流
Variables
{$variable}
Loops:
{% for person in people %}Name: {$person.name}{% endfor %}
If:
{% if person.name == “xu” %}Full name: xu{% endif %}
cpptempl::auto_data data; data["age"] = 10; data["name"] = "xu"; std::string str = "name:{$name}, age:{$age}"; std::string ret = cpptempl::parse(str, data); // ret will be "name:xu, age:10"