Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
[squash] remove template params
Browse files Browse the repository at this point in the history
Removed the template params from the operator methods. Moving the
conversion inside just further hides these downcasts.
  • Loading branch information
kfarnung committed Mar 26, 2018
1 parent 8ae2a34 commit 7fd4285
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/aliased_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ class AliasedBuffer {
index_(that.index_) {
}

template <typename T>
inline Reference& operator=(const T& val) {
inline Reference& operator=(const NativeT& val) {
aliased_buffer_->SetValue(index_, static_cast<NativeT>(val));
return *this;
}
Expand All @@ -142,8 +141,7 @@ class AliasedBuffer {
return aliased_buffer_->GetValue(index_);
}

template <typename T>
inline Reference& operator+=(const T& val) {
inline Reference& operator+=(const NativeT& val) {
const NativeT current = aliased_buffer_->GetValue(index_);
aliased_buffer_->SetValue(index_, current + val);
return *this;
Expand All @@ -153,8 +151,7 @@ class AliasedBuffer {
return this->operator+=(static_cast<NativeT>(val));
}

template <typename T>
inline Reference& operator-=(const T& val) {
inline Reference& operator-=(const NativeT& val) {
const NativeT current = aliased_buffer_->GetValue(index_);
aliased_buffer_->SetValue(index_, current - val);
return *this;
Expand Down

0 comments on commit 7fd4285

Please sign in to comment.