Re: [boost] Report from Berlin C++ Standards Committee meeting

David Abrahams wrote:
"Reece Dunn" <msclrhd@hotmail.com> writes:
Drawing influence from Python, I suggest that the non-throwing version look like:
std::pair<T,bool> string_to<T>(x)
allowing:
fn( string_to<Object>(object).first );
How does that draw influence from Python?
I was refering to multiple-valued returns. For example: def string_to( object ): return object, was_there_an_error obj, err = string_to( ... )
That interface doesn't allow for types that can't be default constructed.
optional<T> string_to<T>(x)
seems more likely.
That does look better. So in that case, an error would be indicated by the optional<T> return containing null. - Reece _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
participants (1)
-
Reece Dunn