|
Boost : |
Subject: Re: [boost] [review] string convert
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2011-05-03 10:48:20
Gordon Woodhull wrote:
> Hi Vladimir, all,
>
> First off, I'll respond to Rob and Jeremy.
>
> Here's again the alternate "simpler"
[purposefully snip context that may not appear in code]
string_convert<int, dont_throw>(s); // or string_convert<int>(s,
_throw=false) if that's impossible
So I'm creating a string from an int but not throwing, is my first
reading of that snippet(maybe I'm "wacky" though). The function name
starts with a common type followed by a verb, followed by a type, so I
This function may appear in some function call:
some_function(string_convert<int, dont_throw>(s));
This requires that I dig up both some_function's signature and the type
of s. Easy you say! What about
template< typename T> void some_function(T t);
template< typename S> void outerFunction(S s)
{
some_function(string_convert<int, dont_throw>(s));
}
I find the "wacky" convert<int>::from(s) much less ambiguous which I
literally read as "convert int from s".
Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk