aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar M. Tong <demon386@gmail.com>2018-07-06 13:31:46 +0800
committerGravatar M. Tong <demon386@gmail.com>2018-07-06 13:42:17 +0800
commit8a1d02626fb206c656564fbd9837029ba09b69eb (patch)
tree587dc0dbbdcc4dc3320544b92e0984a5c33c7f6c
parent79700b56b99fa5c8c22ddef78e6c9557ff711379 (diff)
Fix SFINAE in 'RepeatedPtrFieldBase::Add'
Without this the error of un-moveable GenericTypeHandler will pop until 'TypeHandler::New(arena_, std::move(value))' is called.
-rw-r--r--src/google/protobuf/repeated_field.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h
index fbfbf942..79682b69 100644
--- a/src/google/protobuf/repeated_field.h
+++ b/src/google/protobuf/repeated_field.h
@@ -466,7 +466,7 @@ class LIBPROTOBUF_EXPORT RepeatedPtrFieldBase {
protected:
template <typename TypeHandler>
void Add(typename TypeHandler::Type&& value,
- std::enable_if<TypeHandler::Moveable>* dummy = NULL);
+ typename std::enable_if<TypeHandler::Moveable>::type* dummy = NULL);
template <typename TypeHandler>
void RemoveLast();
@@ -1541,7 +1541,7 @@ inline typename TypeHandler::Type* RepeatedPtrFieldBase::Add(
template <typename TypeHandler>
inline void RepeatedPtrFieldBase::Add(
typename TypeHandler::Type&& value,
- std::enable_if<TypeHandler::Moveable>*) {
+ typename std::enable_if<TypeHandler::Moveable>::type*) {
if (rep_ != NULL && current_size_ < rep_->allocated_size) {
*cast<TypeHandler>(rep_->elements[current_size_++]) = std::move(value);
return;