aboutsummaryrefslogtreecommitdiffstats
path: root/libalee/types.hpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2023-10-12 20:23:50 -0400
committerClyne Sullivan <clyne@bitgloo.com>2023-10-12 20:23:50 -0400
commit15c0c2f789902ac764919913e123466ac46e4746 (patch)
tree937eea767e593798871e6774999b857cdd81509b /libalee/types.hpp
parentd36bb13f52b3899fd0f57e38f00d97e2c3a0f627 (diff)
some class refactoring
Diffstat (limited to 'libalee/types.hpp')
-rw-r--r--libalee/types.hpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/libalee/types.hpp b/libalee/types.hpp
index 95daee6..4d86c5d 100644
--- a/libalee/types.hpp
+++ b/libalee/types.hpp
@@ -23,7 +23,7 @@
#include <iterator>
/**
- * Configure the below three types to match your platform.
+ * Configure the below types for your platform.
*/
using Addr = uint16_t;
using Cell = int16_t;
@@ -48,13 +48,16 @@ enum class Error : int {
};
/**
- * Stores the start and (past-the-)end addresses of a dictionary's word.
+ * Stores the start and past-the-end addresses of a dictionary's word.
*/
-struct Word
+class Word
{
Addr start;
Addr wend;
+public:
+ struct iterator;
+
constexpr explicit Word(Addr s = 0, Addr e = 0):
start(s), wend(e) {}
@@ -64,8 +67,6 @@ struct Word
Addr size() const noexcept;
- // Iterators provided for std::equal.
- struct iterator;
iterator begin(const Dictionary *);
iterator end(const Dictionary *);
@@ -83,6 +84,7 @@ struct Word
addr(a), dict(d) {}
iterator& operator++();
+ iterator operator++(int);
value_type operator*();
bool operator!=(const iterator&);
};