From 7a13336a4e436564333d25d108e5da9ef84d1962 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Thu, 12 Jan 2017 13:38:38 +0100 Subject: [PATCH] make compare functors static --- alib2common/src/container/ObjectsDeque.h | 2 +- alib2common/src/container/ObjectsList.h | 2 +- alib2common/src/container/ObjectsMap.h | 2 +- alib2common/src/container/ObjectsPair.h | 2 +- alib2common/src/container/ObjectsSet.h | 2 +- alib2common/src/container/ObjectsTree.h | 2 +- alib2common/src/container/ObjectsTrie.h | 2 +- alib2common/src/container/ObjectsVector.h | 2 +- alib2common/src/object/AnyObject.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/alib2common/src/container/ObjectsDeque.h b/alib2common/src/container/ObjectsDeque.h index 2eca9e9fac..0433b462c4 100644 --- a/alib2common/src/container/ObjectsDeque.h +++ b/alib2common/src/container/ObjectsDeque.h @@ -81,7 +81,7 @@ ContainerBase * ObjectsDeque < ElementType >::plunder ( ) && { template < class ElementType > int ObjectsDeque < ElementType >::compare ( const ObjectsDeque & other ) const { - std::compare < std::deque < ElementType > > comp; + static std::compare < std::deque < ElementType > > comp; return comp ( static_cast < const std::deque < ElementType > & > ( * this ), static_cast < const std::deque < ElementType > & > ( other ) ); } diff --git a/alib2common/src/container/ObjectsList.h b/alib2common/src/container/ObjectsList.h index fc42141fcf..e886a2d510 100644 --- a/alib2common/src/container/ObjectsList.h +++ b/alib2common/src/container/ObjectsList.h @@ -81,7 +81,7 @@ ContainerBase * ObjectsList < ElementType >::plunder ( ) && { template < class ElementType > int ObjectsList < ElementType >::compare ( const ObjectsList & other ) const { - std::compare < std::list < ElementType > > comp; + static std::compare < std::list < ElementType > > comp; return comp ( static_cast < const std::list < ElementType > & > ( * this ), static_cast < const std::list < ElementType > & > ( other ) ); } diff --git a/alib2common/src/container/ObjectsMap.h b/alib2common/src/container/ObjectsMap.h index bd4b7da321..7b34b54380 100644 --- a/alib2common/src/container/ObjectsMap.h +++ b/alib2common/src/container/ObjectsMap.h @@ -85,7 +85,7 @@ ContainerBase* ObjectsMap<KeyType, ValueType>::plunder() && { template < class KeyType, class ValueType > int ObjectsMap<KeyType, ValueType>::compare(const ObjectsMap& other) const { - std::compare<std::map<KeyType, ValueType>> comp; + static 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 ) ); } diff --git a/alib2common/src/container/ObjectsPair.h b/alib2common/src/container/ObjectsPair.h index bf1147d2e5..90e1075365 100644 --- a/alib2common/src/container/ObjectsPair.h +++ b/alib2common/src/container/ObjectsPair.h @@ -83,7 +83,7 @@ ContainerBase* ObjectsPair < FirstType, SecondType >::plunder() && { template < class FirstType, class SecondType > int ObjectsPair < FirstType, SecondType >::compare(const ObjectsPair& other) const { - std::compare<std::pair<FirstType, SecondType>> comp; + static 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 ) ); } diff --git a/alib2common/src/container/ObjectsSet.h b/alib2common/src/container/ObjectsSet.h index 7c3bbcbf74..953e9bb128 100644 --- a/alib2common/src/container/ObjectsSet.h +++ b/alib2common/src/container/ObjectsSet.h @@ -83,7 +83,7 @@ ContainerBase* ObjectsSet < ElementType >::plunder() && { template < class ElementType > int ObjectsSet < ElementType >::compare(const ObjectsSet& other) const { - std::compare<std::set<ElementType>> comp; + static std::compare<std::set<ElementType>> comp; return comp ( static_cast < const std::set < ElementType > & > ( * this ), static_cast < const std::set < ElementType > & > ( other ) ); } diff --git a/alib2common/src/container/ObjectsTree.h b/alib2common/src/container/ObjectsTree.h index 3924bb08fd..edde9ad250 100644 --- a/alib2common/src/container/ObjectsTree.h +++ b/alib2common/src/container/ObjectsTree.h @@ -76,7 +76,7 @@ ContainerBase * ObjectsTree < ElementType >::plunder ( ) && { template < class ElementType > int ObjectsTree < ElementType >::compare ( const ObjectsTree & other ) const { - std::compare < std::tree < ElementType > > comp; + static std::compare < std::tree < ElementType > > comp; return comp ( static_cast < const std::tree < ElementType > & > ( * this ), static_cast < const std::tree < ElementType > & > ( other ) ); } diff --git a/alib2common/src/container/ObjectsTrie.h b/alib2common/src/container/ObjectsTrie.h index 7d4a33f34e..058676c5a5 100644 --- a/alib2common/src/container/ObjectsTrie.h +++ b/alib2common/src/container/ObjectsTrie.h @@ -78,7 +78,7 @@ ContainerBase * ObjectsTrie < KeyType, ValueType >::plunder ( ) && { template < class KeyType, class ValueType > int ObjectsTrie < KeyType, ValueType >::compare ( const ObjectsTrie & other ) const { - std::compare < std::trie < KeyType, ValueType > > comp; + static std::compare < std::trie < KeyType, ValueType > > comp; return comp ( static_cast < const std::trie < KeyType, ValueType > & > ( * this ), static_cast < const std::trie < KeyType, ValueType > & > ( other ) ); } diff --git a/alib2common/src/container/ObjectsVector.h b/alib2common/src/container/ObjectsVector.h index b46844f94a..c183823bb6 100644 --- a/alib2common/src/container/ObjectsVector.h +++ b/alib2common/src/container/ObjectsVector.h @@ -81,7 +81,7 @@ ContainerBase * ObjectsVector < ElementType >::plunder ( ) && { template < class ElementType > int ObjectsVector < ElementType >::compare ( const ObjectsVector & other ) const { - std::compare < std::vector < ElementType > > comp; + static std::compare < std::vector < ElementType > > comp; return comp ( static_cast < const std::vector < ElementType > & > ( * this ), static_cast < const std::vector < ElementType > & > ( other ) ); } diff --git a/alib2common/src/object/AnyObject.h b/alib2common/src/object/AnyObject.h index 1ceb91312e..c44761d97c 100644 --- a/alib2common/src/object/AnyObject.h +++ b/alib2common/src/object/AnyObject.h @@ -80,7 +80,7 @@ const T & AnyObject < T >::getData ( ) const { template < class T > int AnyObject < T >::compare(const AnyObject < T > & other ) const { - std::compare < decltype ( m_data ) > comp; + static std::compare < decltype ( m_data ) > comp; return comp ( m_data, other.m_data ); } -- GitLab