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

cppcheck: add const qualification

parent 5e07a191
No related branches found
No related tags found
1 merge request!170Cppcheck fixes
......@@ -97,7 +97,7 @@ ext::list < std::unique_ptr < AlgorithmRegistry::Entry > > & AlgorithmRegistry::
}
 
std::shared_ptr < abstraction::OperationAbstraction > AlgorithmRegistry::getAbstraction ( const std::string & name, const ext::vector < std::string > & templateParams, const ext::vector < std::string > & paramTypes, const ext::vector < abstraction::TypeQualifiers::TypeQualifierSet > & typeQualifiers, AlgorithmCategories::AlgorithmCategory category ) {
auto & group = findAbstractionGroup ( name, templateParams );
const auto & group = findAbstractionGroup ( name, templateParams );
 
try {
return getOverload ( group, paramTypes, typeQualifiers, category );
......
......@@ -52,13 +52,13 @@ void OperatorRegistry::unregisterBinaryInternal ( Operators::BinaryOperators typ
}
 
std::shared_ptr < abstraction::OperationAbstraction > OperatorRegistry::getBinaryAbstraction ( Operators::BinaryOperators type, const ext::vector < std::string > & paramTypes, const ext::vector < abstraction::TypeQualifiers::TypeQualifierSet > & typeQualifiers, AlgorithmCategories::AlgorithmCategory category ) {
auto & group = getBinaryEntries ( ) [ type ];
const auto & group = getBinaryEntries ( ) [ type ];
 
return getOverload ( group, paramTypes, typeQualifiers, category );
}
 
ext::list < ext::pair < Operators::BinaryOperators, AlgorithmFullInfo > > OperatorRegistry::listBinaryOverloads ( ) {
auto & group = getBinaryEntries ( );
const auto & group = getBinaryEntries ( );
 
ext::list < ext::pair < Operators::BinaryOperators, AlgorithmFullInfo > > res;
for ( const std::pair < const Operators::BinaryOperators, ext::list < std::unique_ptr < BinaryEntry > > > & overloads : group )
......@@ -103,13 +103,13 @@ void OperatorRegistry::unregisterPrefixInternal ( Operators::PrefixOperators typ
}
 
std::shared_ptr < abstraction::OperationAbstraction > OperatorRegistry::getPrefixAbstraction ( Operators::PrefixOperators type, const ext::vector < std::string > & paramTypes, const ext::vector < abstraction::TypeQualifiers::TypeQualifierSet > & typeQualifiers, AlgorithmCategories::AlgorithmCategory category ) {
auto & group = getPrefixEntries ( ) [ type ];
const auto & group = getPrefixEntries ( ) [ type ];
 
return getOverload ( group, paramTypes, typeQualifiers, category );
}
 
ext::list < ext::pair < Operators::PrefixOperators, AlgorithmFullInfo > > OperatorRegistry::listPrefixOverloads ( ) {
auto & group = getPrefixEntries ( );
const auto & group = getPrefixEntries ( );
 
ext::list < ext::pair < Operators::PrefixOperators, AlgorithmFullInfo > > res;
for ( const std::pair < const Operators::PrefixOperators, ext::list < std::unique_ptr < PrefixEntry > > > & overloads : group )
......@@ -154,13 +154,13 @@ void OperatorRegistry::unregisterPostfixInternal ( Operators::PostfixOperators t
}
 
std::shared_ptr < abstraction::OperationAbstraction > OperatorRegistry::getPostfixAbstraction ( Operators::PostfixOperators type, const ext::vector < std::string > & paramTypes, const ext::vector < abstraction::TypeQualifiers::TypeQualifierSet > & typeQualifiers, AlgorithmCategories::AlgorithmCategory category ) {
auto & group = getPostfixEntries ( ) [ type ];
const auto & group = getPostfixEntries ( ) [ type ];
 
return getOverload ( group, paramTypes, typeQualifiers, category );
}
 
ext::list < ext::pair < Operators::PostfixOperators, AlgorithmFullInfo > > OperatorRegistry::listPostfixOverloads ( ) {
auto & group = getPostfixEntries ( );
const auto & group = getPostfixEntries ( );
 
ext::list < ext::pair < Operators::PostfixOperators, AlgorithmFullInfo > > res;
for ( const std::pair < const Operators::PostfixOperators, ext::list < std::unique_ptr < PostfixEntry > > > & overloads : group )
......
......@@ -133,7 +133,7 @@ public:
/**
* Overload to allow wrapping object in assignment.
*/
reference_wrapper & operator = ( T & object ) {
reference_wrapper & operator = ( const T & object ) {
return * this = reference_wrapper < T > ( object );
}
#endif
......
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