Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-05-27 11:47:05


"John Maddock" <john_at_[hidden]> writes:

>> Can arguments to compressed_pair be const-qualified? The
>> documentation only lists this restriction:
>>
>> Note that compressed_pair can not be instantiated if either of the
>> template arguments is a union type, unless there is compiler support
>> for boost::is_union, or if boost::is_union is specialised for the
>> union type.
>>
>> I believe I am getting an error from Intel C++ when an argument to
>> compressed_pair is const. The question is whether we need a
>> workaround in compressed_pair.hpp or a change to the html
>> documentation.
>
> OK, the following:
>
> boost::compressed_pair<const int, long> cp2;
>
> Gives me a compiler error with VC7.1 (it should as well, but it's not really
> a compressed_pair issue).
>
> Where are this:
>
> boost::compressed_pair<const int, long> cp2(0); compiles as expected.
>
> As does
>
> boost::compressed_pair<const myclass, long> cp2;
>
> as long as myclass has a user-defined default constructor.
>
> That's all exactly what I would expect, what am I missing?

I am getting the error from Intel C++ at the point of declaration of
the compressed_pair specialization.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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