summaryrefslogtreecommitdiff
path: root/tmpl/factory_detail.tmpl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tmpl/factory_detail.tmpl.hpp')
-rw-r--r--tmpl/factory_detail.tmpl.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tmpl/factory_detail.tmpl.hpp b/tmpl/factory_detail.tmpl.hpp
index 87a0756..ea30235 100644
--- a/tmpl/factory_detail.tmpl.hpp
+++ b/tmpl/factory_detail.tmpl.hpp
@@ -16,6 +16,7 @@ struct GRAS_API FactoryRegistryEntry
FactoryRegistryEntry(void);
virtual ~FactoryRegistryEntry(void);
virtual Element *make(const PMCC &args) = 0;
+ void arg_check(const PMCList &args, const size_t nargs);
};
#for $NARGS in range($MAX_ARGS)
@@ -30,7 +31,7 @@ struct FactoryRegistryEntryImpl$(NARGS) : FactoryRegistryEntry
Element *make(const PMCC &args)
{
const PMCList &a = args.as<PMCList>();
- if (a.size() < $NARGS) throw a;
+ this->arg_check(a, $NARGS);
return _fcn($expand('a[%d].safe_as<A%d>()', $NARGS));
}
Fcn _fcn;