C++ string template library

后端 未结 10 1102
清酒与你
清酒与你 2020-12-16 01:23

I want simple C++ string based template library to replace strings at runtime.

For example, I will use

string template = \"My name is {{name}}\";
         


        
10条回答
  •  既然无缘
    2020-12-16 02:00

    For whom is still looking for such a library I have created a little one https://github.com/lexxmark/string_template.

        stpl::string_template st("Hello {{name}}!");
        st.set_arg("name", "World");
        auto r = st.render();
        EXPECT(r, "Hello World!");
    

    It also has some nice customizations.

提交回复
热议问题