diff --git a/sol/simple_usertype_metatable.hpp b/sol/simple_usertype_metatable.hpp index 20315d3a..b27b4ec9 100644 --- a/sol/simple_usertype_metatable.hpp +++ b/sol/simple_usertype_metatable.hpp @@ -263,7 +263,7 @@ namespace sol { template void add(lua_State* L, N&& n, constructor_wrapper c) { - object o(L, in_place>>, std::move(c)); + object o(L, in_place_type>>, std::move(c)); if (std::is_same, call_construction>::value) { callconstructfunc = std::move(o); return; @@ -273,7 +273,7 @@ namespace sol { template void add(lua_State* L, N&& n, constructor_list c) { - object o(L, in_place>>, std::move(c)); + object o(L, in_place_type>>, std::move(c)); if (std::is_same, call_construction>::value) { callconstructfunc = std::move(o); return; @@ -283,7 +283,7 @@ namespace sol { template void add(lua_State* L, N&& n, destructor_wrapper c) { - object o(L, in_place>>, std::move(c)); + object o(L, in_place_type>>, std::move(c)); if (std::is_same, call_construction>::value) { callconstructfunc = std::move(o); return; @@ -293,7 +293,7 @@ namespace sol { template void add(lua_State* L, N&& n, destructor_wrapper c) { - object o(L, in_place>>, std::move(c)); + object o(L, in_place_type>>, std::move(c)); if (std::is_same, call_construction>::value) { callconstructfunc = std::move(o); return; diff --git a/sol/usertype_metatable.hpp b/sol/usertype_metatable.hpp index 720ebfe3..592bcd21 100644 --- a/sol/usertype_metatable.hpp +++ b/sol/usertype_metatable.hpp @@ -213,12 +213,12 @@ namespace sol { template inline std::string make_string(Arg&& arg) { string_detail::string_shim s = make_shim(arg); - return std::string(s.c_str(), s.size()); + return std::string(s.data(), s.size()); } template inline luaL_Reg make_reg(N&& n, lua_CFunction f) { - luaL_Reg l{ make_shim(std::forward(n)).c_str(), f }; + luaL_Reg l{ make_shim(std::forward(n)).data(), f }; return l; } diff --git a/test_strings.cpp b/test_strings.cpp index 98396e20..90c496b7 100644 --- a/test_strings.cpp +++ b/test_strings.cpp @@ -114,7 +114,7 @@ TEST_CASE("object/string-pushers", "test some basic string pushers with in_place sol::state lua; sol::object ocs(lua, sol::in_place, "bark\0bark", 9); - sol::object os(lua, sol::in_place, std::string("bark\0bark", 9), 8); + sol::object os(lua, sol::in_place_type, std::string("bark\0bark", 9), 8); bool test1 = os.as() == std::string("bark\0bar", 8); bool test2 = ocs.as() == std::string("bark\0bark", 9); REQUIRE(test1);