Fix gcc 4.6 errors/issues
This commit is contained in:
parent
1113cafca2
commit
9326539f3b
@ -303,7 +303,7 @@ namespace chaiscript
|
|||||||
ModulePtr sequence_type(const std::string &/*type*/, ModulePtr m = ModulePtr(new Module()))
|
ModulePtr sequence_type(const std::string &/*type*/, ModulePtr m = ModulePtr(new Module()))
|
||||||
{
|
{
|
||||||
m->add(fun(&detail::insert_at<ContainerType>),
|
m->add(fun(&detail::insert_at<ContainerType>),
|
||||||
[](){
|
[]()->std::string{
|
||||||
if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) {
|
if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) {
|
||||||
return "insert_ref_at";
|
return "insert_ref_at";
|
||||||
} else {
|
} else {
|
||||||
@ -329,7 +329,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
typedef void (ContainerType::*push_back)(const typename ContainerType::value_type &);
|
typedef void (ContainerType::*push_back)(const typename ContainerType::value_type &);
|
||||||
m->add(fun(static_cast<push_back>(&ContainerType::push_back)),
|
m->add(fun(static_cast<push_back>(&ContainerType::push_back)),
|
||||||
[](){
|
[]()->std::string{
|
||||||
if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) {
|
if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) {
|
||||||
return "push_back_ref";
|
return "push_back_ref";
|
||||||
} else {
|
} else {
|
||||||
@ -357,7 +357,7 @@ namespace chaiscript
|
|||||||
m->add(fun(static_cast<constfrontptr>(&ContainerType::front)), "front");
|
m->add(fun(static_cast<constfrontptr>(&ContainerType::front)), "front");
|
||||||
|
|
||||||
m->add(fun(static_cast<pushptr>(&ContainerType::push_front)),
|
m->add(fun(static_cast<pushptr>(&ContainerType::push_front)),
|
||||||
[](){
|
[]()->std::string{
|
||||||
if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) {
|
if (typeid(typename ContainerType::value_type) == typeid(Boxed_Value)) {
|
||||||
return "push_front_ref";
|
return "push_front_ref";
|
||||||
} else {
|
} else {
|
||||||
@ -418,7 +418,7 @@ namespace chaiscript
|
|||||||
m->add(fun(&detail::insert<ContainerType>), "insert");
|
m->add(fun(&detail::insert<ContainerType>), "insert");
|
||||||
|
|
||||||
m->add(fun(&detail::insert_ref<ContainerType>),
|
m->add(fun(&detail::insert_ref<ContainerType>),
|
||||||
[](){
|
[]()->std::string{
|
||||||
if (typeid(typename ContainerType::mapped_type) == typeid(Boxed_Value)) {
|
if (typeid(typename ContainerType::mapped_type) == typeid(Boxed_Value)) {
|
||||||
return "insert_ref";
|
return "insert_ref";
|
||||||
} else {
|
} else {
|
||||||
@ -538,7 +538,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
//Special case: add push_back to string (which doesn't support other back_insertion operations
|
//Special case: add push_back to string (which doesn't support other back_insertion operations
|
||||||
m->add(fun(&String::push_back),
|
m->add(fun(&String::push_back),
|
||||||
[](){
|
[]()->std::string{
|
||||||
if (typeid(typename String::value_type) == typeid(Boxed_Value)) {
|
if (typeid(typename String::value_type) == typeid(Boxed_Value)) {
|
||||||
return "push_back_ref";
|
return "push_back_ref";
|
||||||
} else {
|
} else {
|
||||||
|
@ -706,10 +706,10 @@ namespace chaiscript
|
|||||||
virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) const CHAISCRIPT_OVERRIDE{
|
virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) const CHAISCRIPT_OVERRIDE{
|
||||||
|
|
||||||
|
|
||||||
const auto captures = [&](){
|
const auto captures = [&]()->std::map<std::string, Boxed_Value>{
|
||||||
std::map<std::string, Boxed_Value> named_captures;
|
std::map<std::string, Boxed_Value> named_captures;
|
||||||
for (const auto &capture : children[0]->children) {
|
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;
|
return named_captures;
|
||||||
}();
|
}();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user