jeremyong / Selene

Simple C++11 friendly header-only bindings to Lua
zlib License
813 stars 117 forks source link

Unable to call obj functions with std::string arguments #141

Open madeso opened 8 years ago

madeso commented 8 years ago
bool getdog(const std::string& dog);
getdog("dog") // works

int Foo::DoubleAdd(int y);
foo.double_add(3) // works

void Obj::faildog(const std::string& dog);
obj:faildog("dog") // C++ argument is dog "\x5\x1", expected a lua error
obj.faildog("dog") // [string "obj.faildog("dog")"]:1: bad argument #1 to 'faildog' (unregistered type expected, got string)

Visual Studio 2015 on windows + lua 5.3.2, if it matters

Full test sample: https://github.com/madeso/selene-test/blob/master/test_obj.cc

KatekovAnton commented 8 years ago

replace void Obj::faildog(const std::string& dog); with void Obj::faildog(std::string dog);