Boost logo

Boost :

Subject: Re: [boost] [lexical_cast] A suggestion
From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2009-02-06 11:03:31


Alexander Nasonov <alnsn <at> yandex.ru> writes:

> lexical_cast< optional<int> >("x").get_value_or(-1);
> [...]
> It's not conceptually correct but we already have an exception for
> handling spaces in strings. I should think about making one more
> exception for optional<T>. Though, the inliner is not short,
> not sure people will like it.

I can confirm that this is Kevlin's prefered option.

See for example this discussion:

http://lists.boost.org/Archives/boost/2005/05/86492.php

Alex


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk