Rapptz / sol

A C++11 Lua wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Qualifiers in function parameters fails to compile

Rapptz opened this issue · comments

Having const, volatile, or reference qualifiers in function parameters causes (many) compiler errors.

Minimal test case:

#include <sol.hpp>
#include <iostream>

struct test {
    void g(const std::string& str) {
        std::cout << str << '\n';
    }
};

int main() {
    sol::state lua;
    lua.new_userdata<test>("test", "g", &test::g);
    lua.script("x = test.new()\n"
               "x:g('hello')");
}

Fixed.