From 14d429853bc5d2399b23a187c6215511bb52ad01 Mon Sep 17 00:00:00 2001 From: ELynx Date: Fri, 15 Apr 2016 14:00:01 +0300 Subject: [PATCH] Add typename; pass value to resize by const referene --- include/chaiscript/dispatchkit/bootstrap_stl.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index f9a209b..b86b1e4 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -297,8 +297,8 @@ namespace chaiscript template 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"); + m.add(fun([](ContainerType *a, typename ContainerType::size_type n, const typename ContainerType::value_type& val) { return a->resize(n, val); } ), "resize"); + m.add(fun([](ContainerType *a, typename ContainerType::size_type n) { return a->resize(n); } ), "resize"); } template ModulePtr resizable_type(const std::string &type) @@ -314,7 +314,7 @@ namespace chaiscript template void reservable_type(const std::string &/*type*/, Module& m) { - m.add(fun([](ContainerType *a, ContainerType::size_type n) { return a->reserve(n); } ), "reserve"); + m.add(fun([](ContainerType *a, typename ContainerType::size_type n) { return a->reserve(n); } ), "reserve"); } template ModulePtr reservable_type(const std::string &type)