Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-05-27 09:38:15

From: Toon Knapen <toon.knapen_at_[hidden]>
> Jonathan Wakely wrote:
> > Can it be persuaded to do so? Maybe it ignores the cast to size_type
> > and uses an int because -1 will fit in an int, in which case maybe
> > this would make it use a bigger type:
> >
> > enum npos_type { npos = -1UL }
> nope, does not work.

I'm not surprised. The original code cast -1 to size_type, an
unsigned type. The above makes npos a negative integral value
which probably doesn't always interact correctly elsewhere.

Rob Stewart                           stewart_at_[hidden]
Software Engineer           
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at, gregod at, cpdaniel at, john at