Skip to content

Commit

Permalink
fix bugs on Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubpa committed Jan 20, 2021
1 parent 67c9020 commit 2f8f846
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions include/UGM/Interfaces/IArray/IArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <cmath>
#include <cassert>
#include <compare>

namespace Ubpa {
template<typename Base, typename Impl>
Expand Down Expand Up @@ -126,12 +127,12 @@ namespace Ubpa::details {
using IStdArrayBasic<Base, Impl>::operator<;
using IStdArrayBasic<Base, Impl>::operator<=;

bool operator==(const Impl& rhs) const { return this->to_array() == rhs.to_array(); }
bool operator!=(const Impl& rhs) const { return this->to_array() != rhs.to_array(); }
bool operator< (const Impl& rhs) const { return this->to_array() < rhs.to_array(); }
bool operator> (const Impl& rhs) const { return this->to_array() > rhs.to_array(); }
bool operator<=(const Impl& rhs) const { return this->to_array() <= rhs.to_array(); }
bool operator>=(const Impl& rhs) const { return this->to_array() >= rhs.to_array(); }
friend bool operator==(const Impl& lhs, const Impl& rhs) { return lhs.to_array() == rhs.to_array(); }
friend bool operator!=(const Impl& lhs, const Impl& rhs) { return lhs.to_array() != rhs.to_array(); }
friend bool operator< (const Impl& lhs, const Impl& rhs) { return lhs.to_array() < rhs.to_array(); }
friend bool operator> (const Impl& lhs, const Impl& rhs) { return lhs.to_array() > rhs.to_array(); }
friend bool operator<=(const Impl& lhs, const Impl& rhs) { return lhs.to_array() <= rhs.to_array(); }
friend bool operator>=(const Impl& lhs, const Impl& rhs) { return lhs.to_array() >= rhs.to_array(); }
};

template<typename Base, typename Impl>
Expand Down Expand Up @@ -311,7 +312,7 @@ namespace Ubpa::details {
(lhs.template set<Ns>(rhs.template get<Ms>()), ...);
return lhs;
};
return assign_impl(reinterpret_cast<Impl&>(*this), rhs, std::make_integer_sequence<sizeof...(Ns)>{});
return assign_impl(reinterpret_cast<Impl&>(*this), rhs, std::make_index_sequence<sizeof...(Ns)>{});
}
};

Expand Down

0 comments on commit 2f8f846

Please sign in to comment.