[core] Fix misc-unconventional-assign-operator errors in header files

As reported by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-03-27 18:30:35 +02:00
parent ed99a7781a
commit c92be2965c
2 changed files with 6 additions and 2 deletions

View File

@@ -20,11 +20,13 @@ public:
State(Args&&... args) : params(std::forward_as_tuple(::std::forward<Args>(args)...)) {
}
void operator=(const typename T::Type& value) {
State& operator=(const typename T::Type& value) {
if (*this != value) {
setCurrentValue(value);
set(std::index_sequence_for<Args...>{});
}
return *this;
}
bool operator==(const typename T::Type& value) const {

View File

@@ -39,11 +39,13 @@ class UniformState {
public:
UniformState(UniformLocation location_ = -1) : location(location_) {}
void operator=(const Value& value) {
UniformState& operator=(const Value& value) {
if (location >= 0 && (!current || *current != value)) {
current = value;
bindUniform(location, value);
}
return *this;
}
UniformLocation location;