
15 Feb
2012
15 Feb
'12
8:42 a.m.
On Wed, Feb 15, 2012 at 4:27 AM, Nathan Ridge <zeratul976@hotmail.com> wrote:
Compare: 1: set(dict2, "link", (boost::format("../../?q=%s") % name).str()); 2: set(dict2, "link", boost::format("../../?q=%s") % name);
I don't see a problem with 1. It makes your conversion intentions clear, and I don't find it onerous in the least.
(My opinion, of course.)
- Jeff
Upon some reflection, neither of these look natural to me.
What would look natural is the following, implemented using C++11 variadic templates (and then the return value could be a string in the first place):
set(dict2, "link", boost::format("../../?q=%s", name));
Yes, that'd be even better, but variadic templates won't be an option (for me) any time soon. -- Olaf