+GetOpt::ArgumentImpl &GetOpt::add_argument(const string &n, const Store &t, ArgType a)
+{
+ if(a==NO_ARG)
+ throw invalid_argument("GetOpt::add_argument");
+
+ bool have_list = false;
+ bool have_optional = false;
+ for(ArgumentList::const_iterator i=args.begin(); i!=args.end(); ++i)
+ {
+ if((*i)->is_list_store())
+ have_list = true;
+ else if((*i)->get_type()==OPTIONAL_ARG)
+ have_optional = true;
+ }
+
+ if(have_optional && (t.is_list() || a!=OPTIONAL_ARG))
+ throw invalid_argument("GetOpt::add_argument");
+ if(have_list && (t.is_list() || a==OPTIONAL_ARG))
+ throw invalid_argument("GetOpt::add_argument");
+
+ args.push_back(new ArgumentImpl(n, t, a));
+ return *args.back();
+}
+
+GetOpt::OptionImpl &GetOpt::get_option(char s)