Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-05-27 04:48:31


On Thu, May 27, 2004 at 11:14:28AM +0200, Joaqu?n M? L?pez Mu?oz wrote:

> Daniel Frey ha escrito:
>
> > Toon Knapen wrote:
> > > "enum npos_type { npose = -1 }"
>
> A remark here. AFAICS, if vcapp fails in
>
> enum npos_type { npos = (size_type)-1 }
>
> the way Toon explained, it is the compiler's fault, since an enum
> must be large enough to accommodate any integral constant. If I'm
> not wrong, the compiler should make the underlying type
> of npos_type at least 64 bit.

Yes, the compiler should use a larger type than int for the enum.

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 }

Just a thought. I've never used vacpp let alone tested this code with it,

jon

-- 
"It is useless to attempt to reason a man out of a thing
 he was never reasoned into."
	- Jonathan Swift

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