From 7fd4285f2f36d28490e70a9999e0c0eec38807b2 Mon Sep 17 00:00:00 2001 From: Kyle Farnung Date: Mon, 26 Mar 2018 15:25:00 -0700 Subject: [PATCH] [squash] remove template params Removed the template params from the operator methods. Moving the conversion inside just further hides these downcasts. --- src/aliased_buffer.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/aliased_buffer.h b/src/aliased_buffer.h index 58632164b1..2231d1d933 100644 --- a/src/aliased_buffer.h +++ b/src/aliased_buffer.h @@ -127,8 +127,7 @@ class AliasedBuffer { index_(that.index_) { } - template - inline Reference& operator=(const T& val) { + inline Reference& operator=(const NativeT& val) { aliased_buffer_->SetValue(index_, static_cast(val)); return *this; } @@ -142,8 +141,7 @@ class AliasedBuffer { return aliased_buffer_->GetValue(index_); } - template - 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; @@ -153,8 +151,7 @@ class AliasedBuffer { return this->operator+=(static_cast(val)); } - template - 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;