Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error binding global std::string/std::string_view or custom string-like usertype with sol::var #1549

Open
deadlocklogic opened this issue Nov 7, 2023 · 0 comments

Comments

@deadlocklogic
Copy link
Contributor

Minimal repro:

#define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>

#include <string>
#include <string_view>

using std::string;
using std::string_view;

string gValueString;
string_view gValueStringView;

void register_tests(sol::state_view& state) {
    state["gValueString"] = sol::var(gValueString);
    state["gValueStringView"] = sol::var(gValueStringView);
}

//

int main() {
    sol::state lua;

    lua.open_libraries(sol::lib::base,
        sol::lib::math,
        sol::lib::bit32,
        sol::lib::package,
        sol::lib::io,
        sol::lib::string,
        sol::lib::table,
        sol::lib::os,
        sol::lib::debug
    );

    register_tests(lua);
}

Error: C2752 'sol::stack::unqualified_pusher<Tu,void>': more than one partial specialization matches the template argument list
@ThePhD Is it possible to fix such critical issue, and improve the state of binding global/static variables by reference via std::ref?
Again thanks for this awesome library.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant