From 9326539f3bff03f29a4a79dd0e5add0bd44d0c05 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sun, 22 Mar 2015 08:14:59 -0600 Subject: [PATCH] Fix gcc 4.6 errors/issues --- include/chaiscript/dispatchkit/bootstrap_stl.hpp | 10 +++++----- include/chaiscript/language/chaiscript_eval.hpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index f6efe6e..d1330c9 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -303,7 +303,7 @@ namespace chaiscript ModulePtr sequence_type(const std::string &/*type*/, ModulePtr m = ModulePtr(new Module())) { m->add(fun(&detail::insert_at), - [](){ + []()->std::string{ if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) { return "insert_ref_at"; } else { @@ -329,7 +329,7 @@ namespace chaiscript typedef void (ContainerType::*push_back)(const typename ContainerType::value_type &); m->add(fun(static_cast(&ContainerType::push_back)), - [](){ + []()->std::string{ if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) { return "push_back_ref"; } else { @@ -357,7 +357,7 @@ namespace chaiscript m->add(fun(static_cast(&ContainerType::front)), "front"); m->add(fun(static_cast(&ContainerType::push_front)), - [](){ + []()->std::string{ if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) { return "push_front_ref"; } else { @@ -418,7 +418,7 @@ namespace chaiscript m->add(fun(&detail::insert), "insert"); m->add(fun(&detail::insert_ref), - [](){ + []()->std::string{ if (typeid(typename ContainerType::mapped_type) == typeid(Boxed_Value)) { return "insert_ref"; } else { @@ -538,7 +538,7 @@ namespace chaiscript //Special case: add push_back to string (which doesn't support other back_insertion operations m->add(fun(&String::push_back), - [](){ + []()->std::string{ if (typeid(typename String::value_type) == typeid(Boxed_Value)) { return "push_back_ref"; } else { diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp index ae153d1..49db779 100644 --- a/include/chaiscript/language/chaiscript_eval.hpp +++ b/include/chaiscript/language/chaiscript_eval.hpp @@ -706,10 +706,10 @@ namespace chaiscript virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) const CHAISCRIPT_OVERRIDE{ - const auto captures = [&](){ + const auto captures = [&]()->std::map{ std::map named_captures; for (const auto &capture : children[0]->children) { - named_captures.emplace(capture->children[0]->text, capture->children[0]->eval(t_ss)); + named_captures.insert(std::make_pair(capture->children[0]->text, capture->children[0]->eval(t_ss))); } return named_captures; }();