Re: New compose and format API
- From: Daniel Elstner <daniel kitta googlemail com>
- To: Jonathon Jongsma <jonathon jongsma gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: New compose and format API
- Date: Wed, 15 Aug 2007 03:59:08 +0200
Am Dienstag, den 14.08.2007, 13:28 -0500 schrieb Jonathon Jongsma:
> I already gave my opinion to Daniel on IRC, but I thought I'd post
> here as well in case others want to weigh in. My preference is
> currently for option 3. I think the desire to make the interface
> similar to boost is laudable, but I personally find the 'function
> argument' syntax much more readable than the operator% overloading.
> But I do agree that for the common case of passing a plain string or
> number (i.e. without any manipulators), it would be nice to drop the
> extra ustring::format() call.
Done. The API now looks like this:
s = ustring::compose("%1 is lower than %2.",
12, ustring::format(std::hex, 16));
I opted to keep the method names compose() and format() rather than
switching to the boost names format() and group(). Since format() can
be used without compose() it would be strange to call it group():
s = ustring::format(12.3);
Is that OK with you all?
] [Thread Prev