Share

XQilla

Tracker: Bugs

5 copy constructor of Result invalidates const argument - ID: 2887020
Last Update: Settings changed ( jpcs )

In XQilla 2.2.0 the copy constructor of Result (src/runtime/Result.cpp)
doesn't really creates a copy: The old instance becomes invalid.
I'm not sure, what's the reason for this behaviour, but it is unexpected. A
copy constructor should consider its argument as constant!
How can I create a copy of Result then?

Result::Result(const Result &o) : _impl(o._impl)
{
if(_impl) {
_impl->setResultPointer(this);
const_cast<Result&>(o)._impl = 0;
}
}


Robert Haschke ( rhaschke ) - 2009-10-27 09:50

5

Closed

Invalid

Nobody/Anonymous

None

None

Public


Comment ( 1 )

Date: 2009-10-27 11:15
Sender: jpcsProject Admin

Hi Robert,

This isn't a bug, it's a deliberate change. It's never been possible to
copy Results objects like that - previously they were reference counting
wrappers, and now they are auto pointers. If you want a real copy of a
Results object, use ResultImpl::toSequence() to create a Sequence from it.

John


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2009-10-27 11:15 jpcs
resolution_id None 2009-10-27 11:15 jpcs
allow_comments 1 2009-10-27 11:15 jpcs
close_date - 2009-10-27 11:15 jpcs