|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-01-14 17:11:39
Gennaro Prota <gennaro_prota_at_[hidden]> writes:
> I was running some tests on the max_of, min_of etc. templates I've
> proposed some days ago and, *as expected*, VC++ gave problems with
> integral conversions of enumerators. As I think you all know, if you
> have something like
>
> enum e { e1 = 1u << 31 };
>
> then it simply "promotes" e1 to int instead of unsigned int. For
> instance this
>
> enum e { e1 = 2147483648u };
>
> #include <iostream>
>
> int main() {
> std::cout << e1 << '\n';
> }
>
> outputs -2147483648. Applied to my code, where I have e.g.
Are you sure the promotion doesn't happen when e1 is passed to the
streaming operator?
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk