55 m_container (numvalues) {} |
55 m_container (numvalues) {} |
56 |
56 |
57 Container (const C& other) : |
57 Container (const C& other) : |
58 m_container (other) {} |
58 m_container (other) {} |
59 |
59 |
60 Container (std::initializer_list<T>&& a) : |
|
61 m_container (a) {} |
|
62 |
|
63 T& append (const T& value) |
60 T& append (const T& value) |
64 { |
61 { |
65 m_container.push_back (value); |
62 m_container.push_back (value); |
66 return m_container[m_container.size() - 1]; |
63 return m_container[m_container.size() - 1]; |
67 } |
64 } |
327 |
324 |
328 // ------------------------------------------------------------------------------------------------- |
325 // ------------------------------------------------------------------------------------------------- |
329 // |
326 // |
330 |
327 |
331 template<typename T> |
328 template<typename T> |
332 using List = Container<T, std::deque<T>>; |
329 class List : public Container<T, std::deque<T> > |
|
330 { |
|
331 public: |
|
332 typedef Container<T, std::deque<T> > Super; |
|
333 |
|
334 List(){} |
|
335 |
|
336 List (int numvalues) : |
|
337 Super (numvalues) {} |
|
338 |
|
339 List (const Super& other) : |
|
340 Super (other) {} |
|
341 }; |
333 |
342 |
334 // ------------------------------------------------------------------------------------------------- |
343 // ------------------------------------------------------------------------------------------------- |
335 // |
344 // |
336 |
345 |
337 template<typename T> |
346 template<typename T> |
338 class Vector : public Container<T, std::vector<T>> |
347 class Vector : public Container<T, std::vector<T> > |
339 { |
348 { |
340 public: |
349 public: |
341 using Super = Container<T, std::vector<T>>; |
350 typedef Container<T, std::vector<T> > Super; |
342 using typename Super::Container; |
|
343 |
351 |
344 Vector(){} |
352 Vector(){} |
345 |
353 |
346 Vector (T* data, size_t length) : |
354 Vector (T* data, size_t length) : |
347 Super (std::vector<T> (data, data + length)) {} |
355 Super (std::vector<T> (data, data + length)) {} |