Boost logo

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:
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

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

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
Scientific programmer at LKEB, Leiden University Medical Center

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