diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index 0ece3fd..3a67c09 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -294,8 +294,12 @@ namespace chaiscript { m->add(user_type(), type); - m->add(fun(&PairType::first), "first"); - m->add(fun(&PairType::second), "second"); + + typename PairType::first_type PairType::* f = &PairType::first; + typename PairType::second_type PairType::* s = &PairType::second; + + m->add(fun(f), "first"); + m->add(fun(s), "second"); basic_constructors(type, m); m->add(constructor(), type); diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index f032038..0702bd9 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -538,7 +538,8 @@ namespace chaiscript std::streampos size = infile.tellg(); infile.seekg(0, std::ios::beg); - std::vector v(size); + assert(size >= 0); + std::vector v(static_cast(size)); infile.read(&v[0], size); std::string ret_val (v.empty() ? std::string() : std::string (v.begin(), v.end()).c_str());