hughperkins / Jinja2CppLight

(very) lightweight version of Jinja2 for C++
Mozilla Public License 2.0
145 stars 23 forks source link

Can I use Vector of strings in for loop? #3

Open mennahmostafa opened 8 years ago

mennahmostafa commented 8 years ago

Is it possible to do something like this:

{% for auto j: myStringVector %} .. {% endfor %}

hughperkins commented 8 years ago

I use Lua for everything now. see any of the OpenCL files, *.cl in https://github.com/hughperkins/cltorch/tree/master/src/lib eg https://github.com/hughperkins/cltorch/blob/master/src/lib/THClApply.cl

I've factorized out the lua templater into https://github.com/hughperkins/luacpptemplater

Lua is super lightweight (~46KB or so?), but it's an actual real scripting language. So it's perfect for this. I use it for templating OpenCL kernels, at runtime. It works great. No painpoints :-)