diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index 3c93c91..f9a209b 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -295,22 +295,34 @@ namespace chaiscript /// Add container resize concept to the given ContainerType /// http://www.cplusplus.com/reference/stl/ template - ModulePtr resizable_type(const std::string &/*type*/, ModulePtr m = std::make_shared()) - { - m->add(fun([](ContainerType *a, ContainerType::size_type n, ContainerType::value_type val) { return a->resize(n, val); } ), "resize"); - m->add(fun([](ContainerType *a, ContainerType::size_type n) { return a->resize(n, ContainerType::value_type()); } ), "resize"); + void resizable_type(const std::string &/*type*/, Module& m) + { + m.add(fun([](ContainerType *a, ContainerType::size_type n, ContainerType::value_type val) { return a->resize(n, val); } ), "resize"); + m.add(fun([](ContainerType *a, ContainerType::size_type n) { return a->resize(n, ContainerType::value_type()); } ), "resize"); + } + template + ModulePtr resizable_type(const std::string &type) + { + auto m = std::make_shared(); + resizable_type(type, *m); return m; - } + } /// Add container reserve concept to the given ContainerType /// http://www.cplusplus.com/reference/stl/ template - ModulePtr reservable_type(const std::string &/*type*/, ModulePtr m = std::make_shared()) - { - m->add(fun([](ContainerType *a, ContainerType::size_type n) { return a->reserve(n); } ), "reserve"); + void reservable_type(const std::string &/*type*/, Module& m) + { + m.add(fun([](ContainerType *a, ContainerType::size_type n) { return a->reserve(n); } ), "reserve"); + } + template + ModulePtr reservable_type(const std::string &type) + { + auto m = std::make_shared(); + reservable_type(type, *m); return m; - } + } /// Add container concept to the given ContainerType