@@ -29,7 +29,6 @@
2929#include <functional>
3030#include <string>
3131#include <vector>
32−#include <deque>
3332#include <utility>
3433#include <stdexcept>
3534
@@ -57,7 +56,7 @@ public:
5756};
5857
5958const bool undefined = false;
60−const size_t kDataCtor = 0;
59+const std::vector<int>::size_type kDataCtor = 0;
6160
6261// A variant data class designed to provide some features of dynamic typing.
6362//
@@ -74,7 +73,6 @@ class any {
7473 String,
7574 Map,
7675 Vector,
77− Array,
7876 Function,
7977 Closure,
8078 EffFunction,
@@ -82,22 +80,17 @@ class any {
8280 Pointer
8381 };
8482
85− private:
8683 mutable Type type = Type::Unknown;
87− using vector = std::vector<any>;
8884
89− public:
9085 struct as_thunk {
9186 };
9287 static constexpr as_thunk unthunk = as_thunk{};
9388
9489 using map = std::vector<std::pair<const char * const, const any>>;
95− using data = vector;
96− using array = std::deque<any>;
90+ using vector = std::vector<any>;
9791 using fn = auto (*)(const any&) -> any;
9892 using thunk = auto (*)(const as_thunk) -> const any&;
9993
100− private:
10194 class closure {
10295 public:
10396 virtual auto operator()(const any&) const -> any = 0;
@@ -128,7 +121,6 @@ class any {
128121 }
129122 };
130123
131− public:
132124 template <typename T>
133125 using shared = std::shared_ptr<T>;
134126
@@ -147,7 +139,6 @@ class any {
147139 mutable shared<std::string> s;
148140 mutable shared<map> m;
149141 mutable shared<vector> v;
150− mutable shared<array> a;
151142 mutable fn f;
152143 mutable shared<closure> l;
153144 mutable shared<eff_fn> e;
@@ -182,9 +173,6 @@ class any {
182173 any(const vector& val) : type(Type::Vector), v(make_shared<vector>(val)) {}
183174 any(vector&& val) noexcept : type(Type::Vector), v(make_shared<vector>(std::move(val))) {}
184175
185− any(const array& val) : type(Type::Array), a(make_shared<array>(val)) {}
186− any(array&& val) noexcept : type(Type::Array), a(make_shared<array>(std::move(val))) {}
187−
188176 template <typename T>
189177 any(const T& val, typename std::enable_if<std::is_convertible<T,fn>::value>::type* = 0)
190178 : type(Type::Function), f(val) {}
@@ -240,14 +228,8 @@ class any {
240228 template <typename T>
241229 auto cast() const -> typename std::enable_if<std::is_same<T, map>::value, const T&>::type;
242230
243− // These cannot be thunked
244− template <typename T>
245− inline auto cast() const -> typename std::enable_if<std::is_same<T, vector>::value, const T&>::type {
246− return *v;
247− }
248−
249231 template <typename T>
250− auto cast() const -> typename std::enable_if<std::is_same<T, array>::value, const T&>::type;
232+ auto cast() const -> typename std::enable_if<std::is_same<T, vector>::value, const T&>::type;
251233
252234 template <typename T>
253235 auto cast() const -> typename std::enable_if<std::is_assignable<shared<void>,T>::value, typename T::element_type*>::type {
@@ -267,10 +249,9 @@ class any {
267249 operator string() const;
268250 operator const map&() const;
269251 operator const vector&() const;
270− operator const array&() const;
271252
272253 auto operator[](const char[]) const -> const any&;
273− auto operator[](const size_t) const -> const any&;
254+ auto operator[](const vector::size_type) const -> const any&;
274255 auto operator[](const any&) const -> const any&;
275256
276257 auto contains(const char[]) const -> bool;