瀏覽代碼

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

undefined
Sam Hocevar 10 年之前
父節點
當前提交
8160a96b28
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. +15
    -0
      src/lol/base/array.h

+ 15
- 0
src/lol/base/array.h 查看文件

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

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()
{
for (int i = 0; i < m_count; i++)


Loading…
取消
儲存