Skip to content
Snippets Groups Projects
Commit 81b41e2c authored by Guilherme Amadio's avatar Guilherme Amadio Committed by Danilo Piparo
Browse files

Return reference to TVec in assignement operator

Compiler does not know how to convert fData (i.e. std::vector<T>) to
a TVec<T>& by itself.
parent 37b51220
No related branches found
No related tags found
No related merge requests found
......@@ -230,7 +230,7 @@ public:
// assignment
TVec<T> &operator=(const TVec<T> &) = default;
TVec<T> &operator=(TVec<T> &&) = default;
TVec<T> &operator=(std::initializer_list<T> ilist) { return fData = ilist; }
TVec<T> &operator=(std::initializer_list<T> ilist) { fData = ilist; return *this; }
// accessors
reference at(size_type pos) { return fData.at(pos); }
const_reference at(size_type pos) const { return fData.at(pos); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment