Boost logo

Boost :

From: Martin Schulz (Martin.Schulz_at_[hidden])
Date: 2007-03-28 02:58:59


> Nope. Your dialog manager would keep track of the unit and
> set appropriately upon initialization and/or user
> interaction. Your reader would then be as simple as setting
> the value directly to the quantity.
> Alternatively you might have something like this:
>
> quantity<abstract> on_dialog_ok()
> {
> quantity<abstract> dist;
> dist.set_unit(combo.selected_item().data());
> dist.set_value(entry.value().as_double());
> }
>
> No more switch statement smell.

Yes, but then again, the unit of "dist" cannot be hardcoded in its C++
type anymore. I may be missing something, but I do not see how the above
code could be made to work with the library under review.

Yours,
        Martin.


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