Skip to content

Commit

Permalink
Merge pull request #4872 from demon386/master
Browse files Browse the repository at this point in the history
Fix SFINAE in 'RepeatedPtrFieldBase::Add'
  • Loading branch information
Adam Cozzette committed Jul 6, 2018
2 parents 79700b5 + 8a1d026 commit a651b77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/google/protobuf/repeated_field.h
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a651b77

Please sign in to comment.