Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-03-03 03:38:30


Hi Jonathan,

this is just a quick comment:

"Jonathan Turkanis" <technews_at_[hidden]> wrote in message
news:d062af$h9l$1_at_sea.gmane.org...
| Hi All,

| III. The Solution (the ugly part) ---------------------------
|
| The function get presents more of a challenge. Currently it looks like this
(for
| char_type == char):
|
| struct my_input_filter : input_filter {
| template<typename Source>
| int get(Source& src);
| };
|
| The return type already serves a dual purpose: it can store a character or
an
| EOF indication. Unfortunately, with non-blocking or async i/o there are now
| three possible results of a call to get:
|
| 1. A character is successfully retrieved.
| 2. The end of the stream has been reached.
| 3. No characters are currently available, but more may be available later.

isn't this a job for boost::optional<int> ?

-Thorsten


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