Commit d3930e11 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Fix compilation warning.

parent 942eec05
Pipeline #4814 passed with stage
in 26 minutes and 25 seconds
...@@ -27,11 +27,10 @@ namespace hpp { ...@@ -27,11 +27,10 @@ namespace hpp {
template <typename LgT1> bool isEqual template <typename LgT1> bool isEqual
(const LgT1& lgt1, const LiegroupType& lgt2); (const LgT1& lgt1, const LiegroupType& lgt2);
struct IsEqualVisitor : public boost::static_visitor <> struct IsEqualVisitor : public boost::static_visitor <bool>
{ {
inline IsEqualVisitor (const LiegroupType& lg2); inline IsEqualVisitor (const LiegroupType& lg2);
template <typename LgT1> inline void operator () (const LgT1& lg1); template <typename LgT1> inline bool operator () (const LgT1& lg1);
bool result;
private: private:
const LiegroupType& lg2_; const LiegroupType& lg2_;
}; // struct IsEqualVisitor }; // struct IsEqualVisitor
...@@ -39,11 +38,10 @@ namespace hpp { ...@@ -39,11 +38,10 @@ namespace hpp {
namespace level2 { namespace level2 {
template <typename LgT1> template <typename LgT1>
struct IsEqualVisitor : public boost::static_visitor <> struct IsEqualVisitor : public boost::static_visitor <bool>
{ {
inline IsEqualVisitor (const LgT1& lg1); inline IsEqualVisitor (const LgT1& lg1);
template <typename LgT2> inline void operator () (const LgT2& lg2); template <typename LgT2> inline bool operator () (const LgT2& lg2);
bool result;
private: private:
const LgT1& lg1_; const LgT1& lg1_;
}; // struct IsEqualVisitor }; // struct IsEqualVisitor
......
...@@ -23,12 +23,12 @@ namespace hpp { ...@@ -23,12 +23,12 @@ namespace hpp {
{ {
} }
template <typename LgT1> void IsEqualVisitor::operator () template <typename LgT1> bool IsEqualVisitor::operator ()
(const LgT1& lg1) (const LgT1& lg1)
{ {
hppDout (info, hppDout (info,
"level1::isEqual::operator ()"); "level1::isEqual::operator ()");
result = isEqual (lg1, lg2_); return isEqual (lg1, lg2_);
} }
template <typename LgT1> bool isEqual template <typename LgT1> bool isEqual
...@@ -36,8 +36,7 @@ namespace hpp { ...@@ -36,8 +36,7 @@ namespace hpp {
{ {
hppDout (info, "level1::isEqual"); hppDout (info, "level1::isEqual");
level2::IsEqualVisitor<LgT1> visitor (lgt1); level2::IsEqualVisitor<LgT1> visitor (lgt1);
boost::apply_visitor (visitor, lgt2); return boost::apply_visitor (visitor, lgt2);
return visitor.result;
} }
} // namespace level1 } // namespace level1
...@@ -51,11 +50,11 @@ namespace hpp { ...@@ -51,11 +50,11 @@ namespace hpp {
template <typename LgT1> template <typename LgT1>
template <typename LgT2> template <typename LgT2>
void IsEqualVisitor <LgT1>::operator () (const LgT2& lg2) bool IsEqualVisitor <LgT1>::operator () (const LgT2& lg2)
{ {
hppDout (info, "level2::isEqual::operator ()"); hppDout (info, "level2::isEqual::operator ()");
Comparison <LgT1, LgT2> comp; Comparison <LgT1, LgT2> comp;
result = comp (lg1_, lg2); return comp (lg1_, lg2);
} }
} // namespace level2 } // namespace level2
......
...@@ -288,8 +288,8 @@ namespace hpp { ...@@ -288,8 +288,8 @@ namespace hpp {
LiegroupTypes::const_iterator it2 (other.liegroupTypes ().begin ()); LiegroupTypes::const_iterator it2 (other.liegroupTypes ().begin ());
while (it1 != liegroupTypes_.end ()){ while (it1 != liegroupTypes_.end ()){
liegroup::level1::IsEqualVisitor v (*it2); liegroup::level1::IsEqualVisitor v (*it2);
boost::apply_visitor (v, *it1); bool res = boost::apply_visitor (v, *it1);
if (!v.result) return false; if (!res) return false;
++it1; ++it2; ++it1; ++it2;
} }
return true; return true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment