Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#578 closed defect (fixed)

DataWeight and DataWeightProxy do behave different

Reported by: Peter Owned by: Peter
Priority: major Milestone: yat 0.6
Component: utility Version: trunk
Keywords: Cc:

Description

Equality operator for DataWeight is implemented as

bool operator==(const DataWeight& lhs, const DataWeight& rhs)
{
	return lhs.data() == rhs.data();
}

while DataWeightProxy is implemented as

template<typename DataIterator, typename WeightIterator>
bool operator==(const DataWeightProxy<DataIterator, WeightIterator>& lhs,
		const DataWeightProxy<DataIterator, WeightIterator>& rhs)
{
	return lhs.data()==rhs.data() && lhs.weight()==rhs.weight();
}

I suggest DataWeightProxy should be reimplemented, but is it even needed since we allow implicit conversion DataWeightProxy => DataWeight?

Change History (3)

comment:1 Changed 11 years ago by Peter

Component: testutility
Milestone: yat 0.x+yat 0.6
Owner: changed from Jari Häkkinen to Peter
Status: newassigned

comment:2 Changed 11 years ago by Peter

Resolution: fixed
Status: assignedclosed

(In [2122]) Remove implementation of operator==(DataWeightProxy?, DataWeightProxy?) and rather rely on implicit conversion to DataWeight? and its operator. This implies the behavior changes but that change is needed because the previous behavior was very unexpected.

closes #578

comment:3 Changed 11 years ago by Peter

(In [2123]) refs #578. Mention change of DataWeightProxy? in NEWS

Note: See TracTickets for help on using tickets.