Fix for unexpected new base class to std::pair in VS2010. All tests now pass in VS2010

This commit is contained in:
Jason Turner 2010-10-02 20:38:46 +00:00
parent 74e719c053
commit d8c979b204
2 changed files with 8 additions and 3 deletions

View File

@ -294,8 +294,12 @@ namespace chaiscript
{
m->add(user_type<PairType>(), 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<PairType>(type, m);
m->add(constructor<PairType (const typename PairType::first_type &, const typename PairType::second_type &)>(), type);

View File

@ -538,7 +538,8 @@ namespace chaiscript
std::streampos size = infile.tellg();
infile.seekg(0, std::ios::beg);
std::vector<char> v(size);
assert(size >= 0);
std::vector<char> v(static_cast<unsigned int>(size));
infile.read(&v[0], size);
std::string ret_val (v.empty() ? std::string() : std::string (v.begin(), v.end()).c_str());