Commit 56b9b36db002532c85f33324e453e5440988058a
1 parent
8c822b1e
Removed push_back wuthout arguments
Showing
1 changed file
with
1 additions
and
4 deletions
examples11/06-template_metaprogramming/vector.h
@@ -161,14 +161,11 @@ public: | @@ -161,14 +161,11 @@ public: | ||
161 | reserve_internal(cap_rounded_up); | 161 | reserve_internal(cap_rounded_up); |
162 | } | 162 | } |
163 | 163 | ||
164 | - std::tuple<C &> push_back(C &&s) { | 164 | + template <class T> std::tuple<C &> push_back(T &&s) { |
165 | C &r = push_back_single(std::forward<C>(s)); | 165 | C &r = push_back_single(std::forward<C>(s)); |
166 | return std::tuple<C &>(r); | 166 | return std::tuple<C &>(r); |
167 | } | 167 | } |
168 | 168 | ||
169 | -private: | ||
170 | - std::tuple<> push_back() { return std::tuple<>(); } | ||
171 | - | ||
172 | public: | 169 | public: |
173 | template <class T, class... Args> auto push_back(T &&a, Args &&... args) { | 170 | template <class T, class... Args> auto push_back(T &&a, Args &&... args) { |
174 | auto op1 = push_back(std::forward<C>(a)); | 171 | auto op1 = push_back(std::forward<C>(a)); |