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 {
template <typename LgT1> bool isEqual
(const LgT1& lgt1, const LiegroupType& lgt2);
struct IsEqualVisitor : public boost::static_visitor <>
struct IsEqualVisitor : public boost::static_visitor <bool>
{
inline IsEqualVisitor (const LiegroupType& lg2);
template <typename LgT1> inline void operator () (const LgT1& lg1);
bool result;
template <typename LgT1> inline bool operator () (const LgT1& lg1);
private:
const LiegroupType& lg2_;
}; // struct IsEqualVisitor
......@@ -39,11 +38,10 @@ namespace hpp {
namespace level2 {
template <typename LgT1>
struct IsEqualVisitor : public boost::static_visitor <>
struct IsEqualVisitor : public boost::static_visitor <bool>
{
inline IsEqualVisitor (const LgT1& lg1);
template <typename LgT2> inline void operator () (const LgT2& lg2);
bool result;
template <typename LgT2> inline bool operator () (const LgT2& lg2);
private:
const LgT1& lg1_;
}; // struct IsEqualVisitor
......
......@@ -23,12 +23,12 @@ namespace hpp {
{
}
template <typename LgT1> void IsEqualVisitor::operator ()
template <typename LgT1> bool IsEqualVisitor::operator ()
(const LgT1& lg1)
{
hppDout (info,
"level1::isEqual::operator ()");
result = isEqual (lg1, lg2_);
return isEqual (lg1, lg2_);
}
template <typename LgT1> bool isEqual
......@@ -36,8 +36,7 @@ namespace hpp {
{
hppDout (info, "level1::isEqual");
level2::IsEqualVisitor<LgT1> visitor (lgt1);
boost::apply_visitor (visitor, lgt2);
return visitor.result;
return boost::apply_visitor (visitor, lgt2);
}
} // namespace level1
......@@ -51,11 +50,11 @@ namespace hpp {
template <typename LgT1>
template <typename LgT2>
void IsEqualVisitor <LgT1>::operator () (const LgT2& lg2)
bool IsEqualVisitor <LgT1>::operator () (const LgT2& lg2)
{
hppDout (info, "level2::isEqual::operator ()");
Comparison <LgT1, LgT2> comp;
result = comp (lg1_, lg2);
return comp (lg1_, lg2);
}
} // namespace level2
......
......@@ -288,8 +288,8 @@ namespace hpp {
LiegroupTypes::const_iterator it2 (other.liegroupTypes ().begin ());
while (it1 != liegroupTypes_.end ()){
liegroup::level1::IsEqualVisitor v (*it2);
boost::apply_visitor (v, *it1);
if (!v.result) return false;
bool res = boost::apply_visitor (v, *it1);
if (!res) return false;
++it1; ++it2;
}
return true;
......
Markdown is supported
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