Boost logo

Boost :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2008-07-10 05:44:17


On Thu, Jul 10, 2008 at 6:22 AM, Maciej Sobczak <prog_at_[hidden]> wrote:
> Thorsten Ottosen wrote:

[snip]

> BTW - what about optional<bool>?
>
> optional<bool> optional_switch = ...
>
> if (optional_switch)
> {
> // the switch can be "false" here!
> }

But you use a dereference operator to access the value.
Do you find confusing to use a pointer to a bool too?
It seems natural to use the unspecified-bool-type idiom
to me. But this is only personal taste IMHO.

> Isn't it confusing?

I don't find it so. I didn't even knew there were a is_initialized
function. Though I don't find using it any more confusing.
So either way should be good IMO.

[snip]

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

Regards,

-- 
Felipe Magno de Almeida

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