Commit cd6fc15c authored by lrita's avatar lrita

make butil::ScopedVector<T> support initializer_list

parent 6d06398a
...@@ -41,9 +41,9 @@ class ScopedVector { ...@@ -41,9 +41,9 @@ class ScopedVector {
ScopedVector() {} ScopedVector() {}
~ScopedVector() { clear(); } ~ScopedVector() { clear(); }
ScopedVector(RValue other) { swap(*other.object); } ScopedVector(RValue other) { swap(*other.object); }
#if __cplusplus >= 201103L // < C++11 #if __cplusplus >= 201103L // >= C++11
ScopedVector(std::initializer_list<value_type> il) : v_(il) {} ScopedVector(std::initializer_list<value_type> il) : v_(il) {}
#endif // __cplusplus < 201103L #endif
ScopedVector& operator=(RValue rhs) { ScopedVector& operator=(RValue rhs) {
swap(*rhs.object); swap(*rhs.object);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment