libstdc++ of g++ 3.4.x: std::swap and std::auto_ptr causes compilation errors
Tue Nov 16 10:54:00 GMT 2004
Paolo Carlini wrote:
> Vinzenz Feenstra wrote:
>> std::swap of 3.4
>> template<typename _Tp>
>> inline void
>> swap(_Tp& __a, _Tp& __b)
>> // concept requirements
>> const _Tp __tmp = __a; // <-- this is the problem in my opinion
>> __a = __b;
>> __b = __tmp;
> Yes, you are right that this is the ""problem"", in the sense that, being
> auto_ptr not Assignable, later, in __b = __tmp, its assignment operator
> wants a *non* constant reference. We (I) could revert the change which
> const-ified, correctly, the temporary, but the fundamental problem of
> your testcase would remain the same: try compiling it passing,
> on 3.4 or
> on 3.3 (this actually enables the concept check encoded in the
> __glibcpp_function_requires line)
I don't understand, why I have to set it? This is strange to me, too.
Shouldn't it be setted automatically?
I mean this is confusing me abit.
Ok Thanks for explaining.
More information about the Libstdc++