Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-09-12 12:48:51


>
> |The default behaviour is to set the
> | input stream fail bit, so you can check that.
>
> Ok, I guess that goes in hand with the bahavior of the standard library
> (although I prefer throw by default).
>
> could syntax like
>
> std::cin >> io::throw_on_error() >> io::formatob( ... )
> std::cin >> io::default_init_rest() >> io::formatob( ... )
>
> be supported too.?
>

That would be inconsistent with STL stream behavior.
If you want an exception to be thrown, set the steam's exceptions().
Then, when any client code sets the stream's fail bit, automatically an
exception will be thrown.

Example:
std::cin.exceptions(std::ios::failbit);
// if an error happens, an exception will be thrown.
std::cin >> io::formatob(...);

>
> yeah, I know, but at least say pair_fmt instead of pairfmt etc.
>
> | I am not sure what you mean by concatenation.
>
> the contraction of X_fmt to Xfmt.

Quite true! That would make it clearer: container_fmt, pair_frmt,
array_fmt...
So, I second this ;)

Best,
John

-- 
John Torjo
-- john_at_[hidden]
Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- http://www.torjo.com/win32gui/
-- v1.4.0 - save_dlg - true binding of your data to UI controls!
    + easily add validation rules (win32gui/examples/smart_dlg)

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