| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0b27416 commit 75d23ab
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -126,13 +126,11 @@ class AliasedBuffer { | |||
| 126 | 126 | index_(that.index_) { | |
| 127 | 127 | } | |
| 128 | 128 | ||
| 129 | - template <typename T> | ||
| 130 | - inline Reference& operator=(const T& val) { | ||
| 129 | + inline Reference& operator=(const NativeT& val) { | ||
| 131 | 130 | aliased_buffer_->SetValue(index_, val); | |
| 132 | 131 | return *this; | |
| 133 | 132 | } | |
| 134 | 133 | ||
| 135 | - // This is not caught by the template operator= above. | ||
| 136 | 134 | inline Reference& operator=(const Reference& val) { | |
| 137 | 135 | return *this = static_cast<NativeT>(val); | |
| 138 | 136 | } | |
@@ -141,9 +139,8 @@ class AliasedBuffer { | |||
| 141 | 139 | return aliased_buffer_->GetValue(index_); | |
| 142 | 140 | } | |
| 143 | 141 | ||
| 144 | - template <typename T> | ||
| 145 | - inline Reference& operator+=(const T& val) { | ||
| 146 | - const T current = aliased_buffer_->GetValue(index_); | ||
| 142 | + inline Reference& operator+=(const NativeT& val) { | ||
| 143 | + const NativeT current = aliased_buffer_->GetValue(index_); | ||
| 147 | 144 | aliased_buffer_->SetValue(index_, current + val); | |
| 148 | 145 | return *this; | |
| 149 | 146 | } | |
@@ -152,9 +149,10 @@ class AliasedBuffer { | |||
| 152 | 149 | return this->operator+=(static_cast<NativeT>(val)); | |
| 153 | 150 | } | |
| 154 | 151 | ||
| 155 | - template <typename T> | ||
| 156 | - inline Reference& operator-=(const T& val) { | ||
| 157 | - return this->operator+=(-val); | ||
| 152 | + inline Reference& operator-=(const NativeT& val) { | ||
| 153 | + const NativeT current = aliased_buffer_->GetValue(index_); | ||
| 154 | + aliased_buffer_->SetValue(index_, current - val); | ||
| 155 | + return *this; | ||
| 158 | 156 | } | |
| 159 | 157 | ||
| 160 | 158 | private: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments