|
Boost : |
Subject: [boost] [utility] value_initialized fix causes Intel-linux 9.0 compile error
From: Niels Dekker - mail address until 2010-10-10 (niels_address_until_2010-10-10_at_[hidden])
Date: 2009-02-24 14:41:40
My fix of the "const incorrectness" of boost::value_initialized
(changeset [51355]), committed to the trunk last Friday, has passed the
value_init_test tests successfully on most compilers, including
intel-linux 10.0 and 10.1:
www.boost.org/development/tests/trunk/developer/utility_.html
Unfortunately it has a compile time regression failure on intel-linux
9.0, when trying to compare a value_initialized<NonPOD*> and a NonPOD*:
error: more than one operator "==" matches these operands:
built-in operator "pointer == pointer"
built-in operator "pointer == pointer"
operand types are: boost::value_initialized<NonPOD *> == NonPOD *const
www.boost.org/development/tests/trunk/output/Sandia-intel-9-0-boost-bin-v2-libs-utility-test-value_init_test-test-intel-linux-9-0-debug.html
I don't have access to an Intel compiler, but it looks like the compile
error is specific to pointers, as it doesn't seem to occur when
comparing value_initialized<T> and T for other types T (int, double,
POD, NonPOD). Is this a known compiler bug of the Intel 9.0?
Apparently it's fixed by Intel 10.0.
The fix of changeset [51355] replaced the existing conversion operator
by a pair of them, overloaded for const and non-const. See also
https://svn.boost.org/trac/boost/ticket/2548
Would it be okay to just mark the regression failure as "expected", and
leave the implementation of boost::value_initialized as it is, including
the const-fix? Otherwise, do you have any suggestion for a workaround?
Note that the compile error is specific to the implicit use of the
conversion operator. value_initialized also provides "get" functions
and data() member functions to retrieve its value, which should still
work fine on Intel 9.0.
Kind regards, Niels
-- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk