Boost logo

Boost :

From: Maciej Sobczak (prog_at_[hidden])
Date: 2008-07-10 05:22:18


Thorsten Ottosen wrote:

>> Please see <http://soci.sourceforge.net/doc/boost.html> for details.
>
> All the optional examles use 'is_initialized()'. It seems like the
> non-idiomatic way:
>
> if (name.is_initialized())
>
> should be
>
> if( name )
>
> IMO.

I disagree, even though it is not my responsibility to define Boost
idioms. ;-)

The point is that being optional and being a boolean flag are two
different things. Merging them under the same syntax saves keystrokes,
but not the effort to review and understand the code that is already
written.

BTW - what about optional<bool>?

optional<bool> optional_switch = ...

if (optional_switch)
{
     // the switch can be "false" here!
}

Isn't it confusing?

> John Maddock has made the tool "bcp"
>
> http://www.boost.org/doc/libs/1_35_0/tools/bcp/bcp.html
>
> that allows one to easily make a boost library into an independent
> project.

I should have a look at this.

-- 
Maciej Sobczak * www.msobczak.com * www.inspirel.com

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