Browse Source

base: prepare Array for initializer_list when Visual Studio finally has it.

undefined
Sam Hocevar 10 years ago
parent
commit
8160a96b28
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      src/lol/base/array.h

+ 15
- 0
src/lol/base/array.h View File

@@ -24,6 +24,9 @@
#include <new> /* for placement new */ #include <new> /* for placement new */
#include <algorithm> /* for std::swap */ #include <algorithm> /* for std::swap */
#include <stdint.h> #include <stdint.h>
#if 0 // disabled: Visual Studio 2012 doesn't have this
#include <initializer_list>
#endif


namespace lol namespace lol
{ {
@@ -46,6 +49,18 @@ public:
{ {
} }


#if 0
inline ArrayBase(std::initializer_list<Element> list)
: m_data(0),
m_count(0),
m_reserved(0)
{
Reserve(list.size);
for (auto elem : list)
Push(elem);
}
#endif

inline ~ArrayBase() inline ~ArrayBase()
{ {
for (int i = 0; i < m_count; i++) for (int i = 0; i < m_count; i++)


Loading…
Cancel
Save