Skip to content
Snippets Groups Projects
Commit 9b64f3fe authored by Jan Trávníček's avatar Jan Trávníček
Browse files

fix compare of container classes ( add missing & )

parent a2a7b922
No related branches found
No related tags found
No related merge requests found
...@@ -83,12 +83,12 @@ template < class ElementType > ...@@ -83,12 +83,12 @@ template < class ElementType >
int ObjectsDeque < ElementType >::compare ( const ObjectsDeque & other ) const { int ObjectsDeque < ElementType >::compare ( const ObjectsDeque & other ) const {
std::compare < std::deque < ElementType > > comp; std::compare < std::deque < ElementType > > comp;
   
return comp ( static_cast < const std::deque < ElementType > > ( * this ), static_cast < const std::deque < ElementType > > ( other ) ); return comp ( static_cast < const std::deque < ElementType > & > ( * this ), static_cast < const std::deque < ElementType > & > ( other ) );
} }
   
template < class ElementType > template < class ElementType >
void ObjectsDeque < ElementType >::operator >>( std::ostream & os ) const { void ObjectsDeque < ElementType >::operator >>( std::ostream & os ) const {
os << "(ObjectsDeque " << static_cast < const std::deque < ElementType > > ( * this ) << ")"; os << "(ObjectsDeque " << static_cast < const std::deque < ElementType > & > ( * this ) << ")";
} }
   
template < class ElementType > template < class ElementType >
......
...@@ -83,12 +83,12 @@ template < class ElementType > ...@@ -83,12 +83,12 @@ template < class ElementType >
int ObjectsList < ElementType >::compare ( const ObjectsList & other ) const { int ObjectsList < ElementType >::compare ( const ObjectsList & other ) const {
std::compare < std::list < ElementType > > comp; std::compare < std::list < ElementType > > comp;
   
return comp ( static_cast < const std::list < ElementType > > ( * this ), static_cast < const std::list < ElementType > > ( other ) ); return comp ( static_cast < const std::list < ElementType > & > ( * this ), static_cast < const std::list < ElementType > & > ( other ) );
} }
   
template < class ElementType > template < class ElementType >
void ObjectsList < ElementType >::operator >>( std::ostream & os ) const { void ObjectsList < ElementType >::operator >>( std::ostream & os ) const {
os << "(ObjectsList " << static_cast < const std::list < ElementType > > ( * this ) << ")"; os << "(ObjectsList " << static_cast < const std::list < ElementType > & > ( * this ) << ")";
} }
   
template < class ElementType > template < class ElementType >
......
...@@ -86,12 +86,12 @@ ContainerBase* ObjectsMap<KeyType, ValueType>::plunder() && { ...@@ -86,12 +86,12 @@ ContainerBase* ObjectsMap<KeyType, ValueType>::plunder() && {
template < class KeyType, class ValueType > template < class KeyType, class ValueType >
int ObjectsMap<KeyType, ValueType>::compare(const ObjectsMap& other) const { int ObjectsMap<KeyType, ValueType>::compare(const ObjectsMap& other) const {
std::compare<std::map<KeyType, ValueType>> comp; std::compare<std::map<KeyType, ValueType>> comp;
return comp(static_cast<const std::map<KeyType, ValueType>>(*this), static_cast<const std::map<KeyType, ValueType>>(other)); return comp ( static_cast < const std::map < KeyType, ValueType > & > ( * this ), static_cast < const std::map < KeyType, ValueType > & > ( other ) );
} }
   
template < class KeyType, class ValueType > template < class KeyType, class ValueType >
void ObjectsMap<KeyType, ValueType>::operator>>(std::ostream& os) const { void ObjectsMap<KeyType, ValueType>::operator>>(std::ostream& os) const {
os << "(ObjectsMap " << static_cast<const std::map<KeyType, ValueType>>(*this) << ")"; os << "(ObjectsMap " << static_cast < const std::map < KeyType, ValueType > & > ( * this ) << ")";
} }
   
template < class KeyType, class ValueType > template < class KeyType, class ValueType >
......
...@@ -84,12 +84,12 @@ ContainerBase* ObjectsPair < FirstType, SecondType >::plunder() && { ...@@ -84,12 +84,12 @@ ContainerBase* ObjectsPair < FirstType, SecondType >::plunder() && {
template < class FirstType, class SecondType > template < class FirstType, class SecondType >
int ObjectsPair < FirstType, SecondType >::compare(const ObjectsPair& other) const { int ObjectsPair < FirstType, SecondType >::compare(const ObjectsPair& other) const {
std::compare<std::pair<FirstType, SecondType>> comp; std::compare<std::pair<FirstType, SecondType>> comp;
return comp(static_cast<const std::pair<FirstType, SecondType>>(*this), static_cast<const std::pair<FirstType, SecondType>>(other)); return comp ( static_cast < const std::pair < FirstType, SecondType > & > ( * this ), static_cast < const std::pair < FirstType, SecondType > & > ( other ) );
} }
   
template < class FirstType, class SecondType > template < class FirstType, class SecondType >
void ObjectsPair < FirstType, SecondType >::operator>>(std::ostream& os) const { void ObjectsPair < FirstType, SecondType >::operator>>(std::ostream& os) const {
os << "(ObjectsPair " << static_cast<const std::pair<FirstType, SecondType>>(*this) << ")"; os << "(ObjectsPair " << static_cast < const std::pair < FirstType, SecondType > & > ( * this ) << ")";
} }
   
template < class FirstType, class SecondType > template < class FirstType, class SecondType >
......
...@@ -84,12 +84,12 @@ ContainerBase* ObjectsSet < ElementType >::plunder() && { ...@@ -84,12 +84,12 @@ ContainerBase* ObjectsSet < ElementType >::plunder() && {
template < class ElementType > template < class ElementType >
int ObjectsSet < ElementType >::compare(const ObjectsSet& other) const { int ObjectsSet < ElementType >::compare(const ObjectsSet& other) const {
std::compare<std::set<ElementType>> comp; std::compare<std::set<ElementType>> comp;
return comp(static_cast<const std::set<ElementType>>(*this), static_cast<const std::set<ElementType>>(other)); return comp ( static_cast < const std::set < ElementType > & > ( * this ), static_cast < const std::set < ElementType > & > ( other ) );
} }
   
template < class ElementType > template < class ElementType >
void ObjectsSet < ElementType >::operator>>(std::ostream& os) const { void ObjectsSet < ElementType >::operator>>(std::ostream& os) const {
os << "(ObjectsSet " << static_cast<const std::set<ElementType>>(*this) << ")"; os << "(ObjectsSet " << static_cast < const std::set < ElementType > & > ( * this ) << ")";
} }
   
template < class ElementType > template < class ElementType >
......
...@@ -78,12 +78,12 @@ template < class ElementType > ...@@ -78,12 +78,12 @@ template < class ElementType >
int ObjectsTree < ElementType >::compare ( const ObjectsTree & other ) const { int ObjectsTree < ElementType >::compare ( const ObjectsTree & other ) const {
std::compare < std::tree < ElementType > > comp; std::compare < std::tree < ElementType > > comp;
   
return comp ( static_cast < const std::tree < ElementType > > ( * this ), static_cast < const std::tree < ElementType > > ( other ) ); return comp ( static_cast < const std::tree < ElementType > & > ( * this ), static_cast < const std::tree < ElementType > & > ( other ) );
} }
   
template < class ElementType > template < class ElementType >
void ObjectsTree < ElementType >::operator >>( std::ostream & os ) const { void ObjectsTree < ElementType >::operator >>( std::ostream & os ) const {
os << "(ObjectsTree " << static_cast < const std::tree < ElementType > > ( * this ) << ")"; os << "(ObjectsTree " << static_cast < const std::tree < ElementType > & > ( * this ) << ")";
} }
   
template < class ElementType > template < class ElementType >
......
...@@ -83,12 +83,12 @@ template < class ElementType > ...@@ -83,12 +83,12 @@ template < class ElementType >
int ObjectsVector < ElementType >::compare ( const ObjectsVector & other ) const { int ObjectsVector < ElementType >::compare ( const ObjectsVector & other ) const {
std::compare < std::vector < ElementType > > comp; std::compare < std::vector < ElementType > > comp;
   
return comp ( static_cast < const std::vector < ElementType > > ( * this ), static_cast < const std::vector < ElementType > > ( other ) ); return comp ( static_cast < const std::vector < ElementType > & > ( * this ), static_cast < const std::vector < ElementType > & > ( other ) );
} }
   
template < class ElementType > template < class ElementType >
void ObjectsVector < ElementType >::operator >>( std::ostream & os ) const { void ObjectsVector < ElementType >::operator >>( std::ostream & os ) const {
os << "(ObjectsVector " << static_cast < const std::vector < ElementType > > ( * this ) << ")"; os << "(ObjectsVector " << static_cast < const std::vector < ElementType > & > ( * this ) << ")";
} }
   
template < class ElementType > template < class ElementType >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment