Re: [Cppcms-users] Custom form rendering and dynamic widgets
Brought to you by:
artyom-beilis
From: Artyom <art...@ya...> - 2010-08-31 04:27:52
|
> > Ok, thanks for this example. But I still have a problem: Because even > the forms on this page are dynamically allocated, they are stored in a > vector, and because they are not copyable, I store a booster::shared_ptr > to them instead. > I loop with > <% foreach form in forms %> > But the problem is, that now the following construct > <% foreach w as cppcms::form::iterator in form %> > does not work, because the template generator expects form to be the > object itself (and therefore generates form.begin() and form.end() > instead of form->begin() and form->end() which would have to be used > here). You can use: <% foreach w as cppcms::form::iterator in *form %> BTW `as foo` is required only for MSVC as gcc and intel have a construct typeof, so you can just use <% foreach w in *form %> Generally in every place where you use variable you can use "->", ".", "*" and single "()" operator. See: <http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_templates_gen#Syntax+Description+Rules> Artyom |