
On Wed, Feb 15, 2012 at 12:16 PM, Vicente Botet <vicente.botet@wanadoo.fr> wrote:
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));
Note that Boost.Format works differently depending on the locale of the Output Stream. So, I guess your proposal is not an option.
Argh, those silly locales again.
IIRC, when you use explicitly the str function you are stating explicitly that you want to use the default locale.
I don't see yet why
set(dict2, "link", str(format("../../?q=%s") % name)); // 1 set(dict2, "link", format("../../?q=%s") % name); // 2
is not satisfactory.
It's still worse than 2. -- Olaf