summaryrefslogtreecommitdiff
path: root/src/generic
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2015-01-08 14:36:40 -0800
committerBen Longbons <b.r.longbons@gmail.com>2015-01-23 01:44:26 -0800
commit35b95e24ea1915acf0ef13047209f76bce6d9b7b (patch)
tree650cc854b324b0b6f3e269075a394914d0834b26 /src/generic
parentfc07b1e9c72e795e18f9d212e7a72bdb31904c5b (diff)
downloadtmwa-35b95e24ea1915acf0ef13047209f76bce6d9b7b.tar.gz
tmwa-35b95e24ea1915acf0ef13047209f76bce6d9b7b.tar.bz2
tmwa-35b95e24ea1915acf0ef13047209f76bce6d9b7b.tar.xz
tmwa-35b95e24ea1915acf0ef13047209f76bce6d9b7b.zip
Use generated config for login
Diffstat (limited to 'src/generic')
-rw-r--r--src/generic/array.hpp9
-rw-r--r--src/generic/fwd.hpp16
2 files changed, 18 insertions, 7 deletions
diff --git a/src/generic/array.hpp b/src/generic/array.hpp
index dccb91e..3575db6 100644
--- a/src/generic/array.hpp
+++ b/src/generic/array.hpp
@@ -26,6 +26,7 @@
#include "oops.hpp"
+// half the important stuff is now in fwd.hpp !!!
namespace tmwa
{
template<class I, I be, I en>
@@ -39,9 +40,6 @@ struct ExclusiveIndexing
constexpr static size_t alloc_size = index_to_offset(en) - index_to_offset(be);
};
-template<size_t n>
-using SimpleIndexing = ExclusiveIndexing<size_t, 0, n>;
-
template<class I, I lo, I hi>
struct InclusiveIndexing
{
@@ -53,7 +51,7 @@ struct InclusiveIndexing
constexpr static size_t alloc_size = index_to_offset(hi) - index_to_offset(lo) + 1;
};
-template<class E, E n=E::COUNT>
+template<class E, E n>
struct EnumIndexing : ExclusiveIndexing<E, static_cast<E>(0), n>
{
};
@@ -112,7 +110,4 @@ public:
return !(lhs == rhs);
}
};
-
-template<class T, size_t n>
-using Array = GenericArray<T, SimpleIndexing<n>>;
} // namespace tmwa
diff --git a/src/generic/fwd.hpp b/src/generic/fwd.hpp
index 2517d62..0527290 100644
--- a/src/generic/fwd.hpp
+++ b/src/generic/fwd.hpp
@@ -39,4 +39,20 @@ template<class K, class V>
class UPMap;
class InternPool;
+
+// arrays are complicated
+template<class I, I be, I en>
+struct ExclusiveIndexing;
+template<size_t n>
+using SimpleIndexing = ExclusiveIndexing<size_t, 0, n>;
+template<class I, I lo, I hi>
+struct InclusiveIndexing;
+template<class E, E n=E::COUNT>
+struct EnumIndexing;
+template<class I, size_t limit>
+struct InventoryIndexing;
+template<class T, class I>
+struct GenericArray;
+template<class T, size_t n>
+using Array = GenericArray<T, SimpleIndexing<n>>;
} // namespace tmwa