summaryrefslogtreecommitdiff
path: root/option.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-24 20:01:51 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-24 20:01:51 -0400
commitc6860970f27ed1f0d9b9543da46ffffa5c20e8f6 (patch)
tree8dcdf28f18164d8cc099857633c41e70022f90be /option.h
parent2943af2761e6ac5064db077046e230fa1c2b06dd (diff)
downloadfork-ledger-c6860970f27ed1f0d9b9543da46ffffa5c20e8f6.tar.gz
fork-ledger-c6860970f27ed1f0d9b9543da46ffffa5c20e8f6.tar.bz2
fork-ledger-c6860970f27ed1f0d9b9543da46ffffa5c20e8f6.zip
removed all uses of std::vector; simplified some code
Diffstat (limited to 'option.h')
-rw-r--r--option.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/option.h b/option.h
index 9952d7d5..a0f1e418 100644
--- a/option.h
+++ b/option.h
@@ -3,7 +3,6 @@
#include <map>
#include <list>
-#include <vector>
#include <string>
struct option_handler;
@@ -23,8 +22,8 @@ typedef std::pair<const std::string, option_handler *> option_handler_pair;
struct option_handler {
bool handled;
- static std::vector<option_t> options;
- static option_handler_map handlers;
+ static std::list<option_t> options;
+ static option_handler_map handlers;
option_handler(const std::string& label,
const std::string& opt_chars);
@@ -37,9 +36,9 @@ void process_arguments(int argc, char ** argv, const bool anywhere,
std::list<std::string>& args);
void process_environment(char ** envp, const std::string& tag);
-#define DEF_OPT_HANDLERS() \
- std::vector<option_t> option_handler::options; \
- option_handler_map option_handler::handlers
+#define DEF_OPT_HANDLERS() \
+ std::list<option_t> option_handler::options; \
+ option_handler_map option_handler::handlers
#define OPT_BEGIN(tag, chars) \
static struct opt_ ## tag ## _handler : public option_handler { \