backport JSON for G++4.6

This commit is contained in:
Jason Turner 2015-09-21 12:27:33 -06:00
parent e62a38b39f
commit 681f18ee62
3 changed files with 5 additions and 5 deletions

View File

@ -40,7 +40,7 @@ namespace chaiscript
{ {
const bool has_arity_match = std::any_of(funcs.begin(), funcs.end(), const bool has_arity_match = std::any_of(funcs.begin(), funcs.end(),
[](const Const_Proxy_Function &f) { [](const Const_Proxy_Function &f) {
return f->get_arity() == -1 || f->get_arity() == chaiscript::dispatch::detail::Arity<FunctionType>::arity; return f->get_arity() == -1 || size_t(f->get_arity()) == chaiscript::dispatch::detail::Arity<FunctionType>::arity;
}); });
if (!has_arity_match) { if (!has_arity_match) {

View File

@ -107,13 +107,13 @@ class JSON
JSON() : Internal(), Type( Class::Null ){} JSON() : Internal(), Type( Class::Null ){}
explicit JSON(Class type) explicit JSON(Class type)
: JSON() : Internal(), Type(Class::Null)
{ {
SetType( type ); SetType( type );
} }
JSON( initializer_list<JSON> list ) JSON( initializer_list<JSON> list )
: JSON() : Internal(), Type(Class::Null)
{ {
SetType( Class::Object ); SetType( Class::Object );
for( auto i = list.begin(), e = list.end(); i != e; ++i, ++i ) for( auto i = list.begin(), e = list.end(); i != e; ++i, ++i )
@ -418,7 +418,7 @@ class JSON
private: private:
Class Type = Class::Null; Class Type;
}; };
JSON Array() { JSON Array() {

View File

@ -32,7 +32,7 @@ namespace chaiscript
for (const auto &p : t_json.ObjectRange()) for (const auto &p : t_json.ObjectRange())
{ {
m.emplace(p.first, from_json(p.second)); m.insert(std::make_pair(p.first, from_json(p.second)));
} }
return Boxed_Value(m); return Boxed_Value(m);