mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
std::cend doesn't exist in C++11
remove unused variables detected by clang and g++ appease the parenthesis monster that was put into g++ 5.0
This commit is contained in:
parent
ca685e01c9
commit
b86d90f0e5
|
@ -20,8 +20,8 @@
|
||||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// This file was generated with a script.
|
// This file was generated with a script.
|
||||||
// Generated 2017-08-07 06:06:53.826612 UTC
|
// Generated 2017-08-07 06:26:17.141906 UTC
|
||||||
// This header was generated with sol v2.18.0 (revision 03c229b)
|
// This header was generated with sol v2.18.0 (revision ca685e0)
|
||||||
// https://github.com/ThePhD/sol2
|
// https://github.com/ThePhD/sol2
|
||||||
|
|
||||||
#ifndef SOL_SINGLE_INCLUDE_HPP
|
#ifndef SOL_SINGLE_INCLUDE_HPP
|
||||||
|
@ -6201,8 +6201,8 @@ namespace sol {
|
||||||
|
|
||||||
template <typename V>
|
template <typename V>
|
||||||
static void insert_at_end(std::true_type, types<V>, lua_State* L, T& arr, std::size_t) {
|
static void insert_at_end(std::true_type, types<V>, lua_State* L, T& arr, std::size_t) {
|
||||||
using std::cend;
|
using std::end;
|
||||||
arr.insert(cend(arr), stack::get<V>(L, -lua_size<V>::value));
|
arr.insert(end(arr), stack::get<V>(L, -lua_size<V>::value));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename V>
|
template <typename V>
|
||||||
|
@ -8268,7 +8268,7 @@ namespace sol {
|
||||||
namespace sol {
|
namespace sol {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
inline const std::string& default_chunk_name() {
|
inline const std::string& default_chunk_name() {
|
||||||
static const std::string name = "script";
|
static const std::string name = "";
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13675,12 +13675,12 @@ namespace sol {
|
||||||
return luaL_error(L, "sol: cannot call '__pairs' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
return luaL_error(L, "sol: cannot call '__pairs' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator begin(lua_State* L, T& self) {
|
static iterator begin(lua_State* L, T&) {
|
||||||
luaL_error(L, "sol: cannot call 'being' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
luaL_error(L, "sol: cannot call 'being' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
||||||
return lua_nil;
|
return lua_nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator end(lua_State* L, T& self) {
|
static iterator end(lua_State* L, T&) {
|
||||||
luaL_error(L, "sol: cannot call 'end' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
luaL_error(L, "sol: cannot call 'end' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
||||||
return lua_nil;
|
return lua_nil;
|
||||||
}
|
}
|
||||||
|
@ -13798,7 +13798,7 @@ namespace sol {
|
||||||
return get_associative(is_associative(), L, it);
|
return get_associative(is_associative(), L, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_comparative(std::false_type, lua_State* L, T& self, K& key) {
|
static int get_comparative(std::false_type, lua_State* L, T&, K&) {
|
||||||
return luaL_error(L, "cannot get this key on '%s': no suitable way to increment iterator and compare to key value '%s'", detail::demangle<T>().data(), detail::demangle<K>().data());
|
return luaL_error(L, "cannot get this key on '%s': no suitable way to increment iterator and compare to key value '%s'", detail::demangle<T>().data(), detail::demangle<K>().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13880,7 +13880,7 @@ namespace sol {
|
||||||
set_writable(is_writable(), L, self, it, std::move(value));
|
set_writable(is_writable(), L, self, it, std::move(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_comparative(std::false_type, lua_State* L, T& self, stack_object key, stack_object value) {
|
static void set_comparative(std::false_type, lua_State* L, T&, stack_object, stack_object) {
|
||||||
luaL_error(L, "cannot set this value on '%s': no suitable way to increment iterator or compare to '%s' key", detail::demangle<T>().data(), detail::demangle<K>().data());
|
luaL_error(L, "cannot set this value on '%s': no suitable way to increment iterator or compare to '%s' key", detail::demangle<T>().data(), detail::demangle<K>().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14442,11 +14442,11 @@ namespace sol {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator begin(lua_State* L, T& self) {
|
static iterator begin(lua_State*, T& self) {
|
||||||
return std::addressof(self[0]);
|
return std::addressof(self[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator end(lua_State* L, T& self) {
|
static iterator end(lua_State*, T& self) {
|
||||||
return std::addressof(self[std::extent<T>::value]);
|
return std::addressof(self[std::extent<T>::value]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -14690,7 +14690,6 @@ namespace sol {
|
||||||
} };
|
} };
|
||||||
|
|
||||||
if (luaL_newmetatable(L, metakey) == 1) {
|
if (luaL_newmetatable(L, metakey) == 1) {
|
||||||
stack_reference metatable(L, -1);
|
|
||||||
luaL_setfuncs(L, reg.data(), 0);
|
luaL_setfuncs(L, reg.data(), 0);
|
||||||
}
|
}
|
||||||
lua_setmetatable(L, -2);
|
lua_setmetatable(L, -2);
|
||||||
|
@ -15990,7 +15989,7 @@ namespace sol {
|
||||||
lua_error(L);
|
lua_error(L);
|
||||||
}
|
}
|
||||||
set_environment(env, stack_reference(L, raw_index(index + 1)));
|
set_environment(env, stack_reference(L, raw_index(index + 1)));
|
||||||
if (lua_call(L, 0, LUA_MULTRET)) {
|
if (lua_pcall(L, 0, LUA_MULTRET, 0)) {
|
||||||
lua_error(L);
|
lua_error(L);
|
||||||
}
|
}
|
||||||
int postindex = lua_gettop(L);
|
int postindex = lua_gettop(L);
|
||||||
|
@ -16013,7 +16012,7 @@ namespace sol {
|
||||||
lua_error(L);
|
lua_error(L);
|
||||||
}
|
}
|
||||||
set_environment(env, stack_reference(L, raw_index(index + 1)));
|
set_environment(env, stack_reference(L, raw_index(index + 1)));
|
||||||
if (lua_call(L, 0, LUA_MULTRET)) {
|
if (lua_pcall(L, 0, LUA_MULTRET, 0)) {
|
||||||
lua_error(L);
|
lua_error(L);
|
||||||
}
|
}
|
||||||
int postindex = lua_gettop(L);
|
int postindex = lua_gettop(L);
|
||||||
|
|
|
@ -351,12 +351,12 @@ namespace sol {
|
||||||
return luaL_error(L, "sol: cannot call '__pairs' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
return luaL_error(L, "sol: cannot call '__pairs' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator begin(lua_State* L, T& self) {
|
static iterator begin(lua_State* L, T&) {
|
||||||
luaL_error(L, "sol: cannot call 'being' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
luaL_error(L, "sol: cannot call 'being' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
||||||
return lua_nil;
|
return lua_nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator end(lua_State* L, T& self) {
|
static iterator end(lua_State* L, T&) {
|
||||||
luaL_error(L, "sol: cannot call 'end' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
luaL_error(L, "sol: cannot call 'end' on type '%s': it is not recognized as a container", detail::demangle<T>().c_str());
|
||||||
return lua_nil;
|
return lua_nil;
|
||||||
}
|
}
|
||||||
|
@ -474,7 +474,7 @@ namespace sol {
|
||||||
return get_associative(is_associative(), L, it);
|
return get_associative(is_associative(), L, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_comparative(std::false_type, lua_State* L, T& self, K& key) {
|
static int get_comparative(std::false_type, lua_State* L, T&, K&) {
|
||||||
return luaL_error(L, "cannot get this key on '%s': no suitable way to increment iterator and compare to key value '%s'", detail::demangle<T>().data(), detail::demangle<K>().data());
|
return luaL_error(L, "cannot get this key on '%s': no suitable way to increment iterator and compare to key value '%s'", detail::demangle<T>().data(), detail::demangle<K>().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,7 +556,7 @@ namespace sol {
|
||||||
set_writable(is_writable(), L, self, it, std::move(value));
|
set_writable(is_writable(), L, self, it, std::move(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_comparative(std::false_type, lua_State* L, T& self, stack_object key, stack_object value) {
|
static void set_comparative(std::false_type, lua_State* L, T&, stack_object, stack_object) {
|
||||||
luaL_error(L, "cannot set this value on '%s': no suitable way to increment iterator or compare to '%s' key", detail::demangle<T>().data(), detail::demangle<K>().data());
|
luaL_error(L, "cannot set this value on '%s': no suitable way to increment iterator or compare to '%s' key", detail::demangle<T>().data(), detail::demangle<K>().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1118,11 +1118,11 @@ namespace sol {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator begin(lua_State* L, T& self) {
|
static iterator begin(lua_State*, T& self) {
|
||||||
return std::addressof(self[0]);
|
return std::addressof(self[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterator end(lua_State* L, T& self) {
|
static iterator end(lua_State*, T& self) {
|
||||||
return std::addressof(self[std::extent<T>::value]);
|
return std::addressof(self[std::extent<T>::value]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -258,7 +258,6 @@ namespace sol {
|
||||||
} };
|
} };
|
||||||
|
|
||||||
if (luaL_newmetatable(L, metakey) == 1) {
|
if (luaL_newmetatable(L, metakey) == 1) {
|
||||||
stack_reference metatable(L, -1);
|
|
||||||
luaL_setfuncs(L, reg.data(), 0);
|
luaL_setfuncs(L, reg.data(), 0);
|
||||||
}
|
}
|
||||||
lua_setmetatable(L, -2);
|
lua_setmetatable(L, -2);
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
namespace sol {
|
namespace sol {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
inline const std::string& default_chunk_name() {
|
inline const std::string& default_chunk_name() {
|
||||||
static const std::string name = "script";
|
static const std::string name = "";
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,8 @@ namespace sol {
|
||||||
|
|
||||||
template <typename V>
|
template <typename V>
|
||||||
static void insert_at_end(std::true_type, types<V>, lua_State* L, T& arr, std::size_t) {
|
static void insert_at_end(std::true_type, types<V>, lua_State* L, T& arr, std::size_t) {
|
||||||
using std::cend;
|
using std::end;
|
||||||
arr.insert(cend(arr), stack::get<V>(L, -lua_size<V>::value));
|
arr.insert(end(arr), stack::get<V>(L, -lua_size<V>::value));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename V>
|
template <typename V>
|
||||||
|
|
|
@ -368,7 +368,7 @@ namespace sol {
|
||||||
lua_error(L);
|
lua_error(L);
|
||||||
}
|
}
|
||||||
set_environment(env, stack_reference(L, raw_index(index + 1)));
|
set_environment(env, stack_reference(L, raw_index(index + 1)));
|
||||||
if (lua_call(L, 0, LUA_MULTRET)) {
|
if (lua_pcall(L, 0, LUA_MULTRET, 0)) {
|
||||||
lua_error(L);
|
lua_error(L);
|
||||||
}
|
}
|
||||||
int postindex = lua_gettop(L);
|
int postindex = lua_gettop(L);
|
||||||
|
@ -391,7 +391,7 @@ namespace sol {
|
||||||
lua_error(L);
|
lua_error(L);
|
||||||
}
|
}
|
||||||
set_environment(env, stack_reference(L, raw_index(index + 1)));
|
set_environment(env, stack_reference(L, raw_index(index + 1)));
|
||||||
if (lua_call(L, 0, LUA_MULTRET)) {
|
if (lua_pcall(L, 0, LUA_MULTRET, 0)) {
|
||||||
lua_error(L);
|
lua_error(L);
|
||||||
}
|
}
|
||||||
int postindex = lua_gettop(L);
|
int postindex = lua_gettop(L);
|
||||||
|
|
|
@ -106,21 +106,21 @@ end
|
||||||
std::size_t idx = 0;
|
std::size_t idx = 0;
|
||||||
for (const auto& i : items) {
|
for (const auto& i : items) {
|
||||||
const auto& v = values[idx];
|
const auto& v = values[idx];
|
||||||
REQUIRE(i == v);
|
REQUIRE((i == v));
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
REQUIRE(s1 == 6);
|
REQUIRE((s1 == 6));
|
||||||
REQUIRE(s2 == 5);
|
REQUIRE((s2 == 5));
|
||||||
REQUIRE(s3 == 4);
|
REQUIRE((s3 == 4));
|
||||||
REQUIRE(len == 6);
|
REQUIRE((len == 6));
|
||||||
REQUIRE(first == 20);
|
REQUIRE((first == 20));
|
||||||
REQUIRE(last == 18);
|
REQUIRE((last == 18));
|
||||||
REQUIRE(i1 == 1);
|
REQUIRE((i1 == 1));
|
||||||
REQUIRE(i2 == 4);
|
REQUIRE((i2 == 4));
|
||||||
REQUIRE(v1 == 11);
|
REQUIRE((v1 == 11));
|
||||||
REQUIRE(v2 == 13);
|
REQUIRE((v2 == 13));
|
||||||
REQUIRE(v3 == 18);
|
REQUIRE((v3 == 18));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -215,21 +215,21 @@ end
|
||||||
std::size_t idx = 0;
|
std::size_t idx = 0;
|
||||||
for (const auto& i : items) {
|
for (const auto& i : items) {
|
||||||
const auto& v = values[idx];
|
const auto& v = values[idx];
|
||||||
REQUIRE(i == v);
|
REQUIRE((i == v));
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
REQUIRE(s1 == 7);
|
REQUIRE((s1 == 7));
|
||||||
REQUIRE(s2 == 6);
|
REQUIRE((s2 == 6));
|
||||||
REQUIRE(s3 == 5);
|
REQUIRE((s3 == 5));
|
||||||
REQUIRE(len == 7);
|
REQUIRE((len == 7));
|
||||||
REQUIRE(first == 12);
|
REQUIRE((first == 12));
|
||||||
REQUIRE(last == 20);
|
REQUIRE((last == 20));
|
||||||
REQUIRE(i1 == 11);
|
REQUIRE((i1 == 11));
|
||||||
REQUIRE(i2 == 14);
|
REQUIRE((i2 == 14));
|
||||||
REQUIRE(v1 == 11);
|
REQUIRE((v1 == 11));
|
||||||
REQUIRE(v2 == 13);
|
REQUIRE((v2 == 13));
|
||||||
REQUIRE(v3 == 20);
|
REQUIRE((v3 == 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -302,20 +302,20 @@ void unordered_container_check(sol::state& lua, T& items) {
|
||||||
for (const auto& i : items) {
|
for (const auto& i : items) {
|
||||||
const auto& v = values[idx];
|
const auto& v = values[idx];
|
||||||
auto it = items.find(v);
|
auto it = items.find(v);
|
||||||
REQUIRE(it != items.cend());
|
REQUIRE((it != items.cend()));
|
||||||
REQUIRE(*it == v);
|
REQUIRE((*it == v));
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
REQUIRE(s1 == 7);
|
REQUIRE((s1 == 7));
|
||||||
REQUIRE(s2 == 6);
|
REQUIRE((s2 == 6));
|
||||||
REQUIRE(s3 == 5);
|
REQUIRE((s3 == 5));
|
||||||
REQUIRE(len == 7);
|
REQUIRE((len == 7));
|
||||||
REQUIRE(i1 == 11);
|
REQUIRE((i1 == 11));
|
||||||
REQUIRE(i2 == 14);
|
REQUIRE((i2 == 14));
|
||||||
REQUIRE(v1 == 11);
|
REQUIRE((v1 == 11));
|
||||||
REQUIRE(v2 == 13);
|
REQUIRE((v2 == 13));
|
||||||
REQUIRE(v3 == 20);
|
REQUIRE((v3 == 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -418,23 +418,23 @@ end
|
||||||
std::size_t idx = 0;
|
std::size_t idx = 0;
|
||||||
for (const auto& i : items) {
|
for (const auto& i : items) {
|
||||||
const auto& v = values[idx];
|
const auto& v = values[idx];
|
||||||
REQUIRE(i == v);
|
REQUIRE((i == v));
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
REQUIRE(s1 == 7);
|
REQUIRE((s1 == 7));
|
||||||
REQUIRE(s2 == 6);
|
REQUIRE((s2 == 6));
|
||||||
REQUIRE(s3 == 5);
|
REQUIRE((s3 == 5));
|
||||||
REQUIRE(len == 7);
|
REQUIRE((len == 7));
|
||||||
REQUIRE(first.first == 12);
|
REQUIRE((first.first == 12));
|
||||||
REQUIRE(last.first == 20);
|
REQUIRE((last.first == 20));
|
||||||
REQUIRE(first.second == 31);
|
REQUIRE((first.second == 31));
|
||||||
REQUIRE(last.second == 30);
|
REQUIRE((last.second == 30));
|
||||||
REQUIRE(i1 == 21);
|
REQUIRE((i1 == 21));
|
||||||
REQUIRE(i2 == 24);
|
REQUIRE((i2 == 24));
|
||||||
REQUIRE(v1 == 21);
|
REQUIRE((v1 == 21));
|
||||||
REQUIRE(v2 == 23);
|
REQUIRE((v2 == 23));
|
||||||
REQUIRE(v3 == 30);
|
REQUIRE((v3 == 30));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -516,20 +516,20 @@ void associative_unordered_container_check(sol::state& lua, T& items) {
|
||||||
for (const auto& i : items) {
|
for (const auto& i : items) {
|
||||||
const auto& v = values[idx];
|
const auto& v = values[idx];
|
||||||
auto it = items.find(v.first);
|
auto it = items.find(v.first);
|
||||||
REQUIRE(it != items.cend());
|
REQUIRE((it != items.cend()));
|
||||||
REQUIRE(it->second == v.second);
|
REQUIRE((it->second == v.second));
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
REQUIRE(s1 == 7);
|
REQUIRE((s1 == 7));
|
||||||
REQUIRE(s2 == 6);
|
REQUIRE((s2 == 6));
|
||||||
REQUIRE(s3 == 5);
|
REQUIRE((s3 == 5));
|
||||||
REQUIRE(len == 7);
|
REQUIRE((len == 7));
|
||||||
REQUIRE(i1 == 21);
|
REQUIRE((i1 == 21));
|
||||||
REQUIRE(i2 == 24);
|
REQUIRE((i2 == 24));
|
||||||
REQUIRE(v1 == 21);
|
REQUIRE((v1 == 21));
|
||||||
REQUIRE(v2 == 23);
|
REQUIRE((v2 == 23));
|
||||||
REQUIRE(v3 == 30);
|
REQUIRE((v3 == 30));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -624,21 +624,21 @@ end
|
||||||
std::size_t idx = 0;
|
std::size_t idx = 0;
|
||||||
for (const auto& i : items) {
|
for (const auto& i : items) {
|
||||||
const auto& v = values[idx];
|
const auto& v = values[idx];
|
||||||
REQUIRE(i == v);
|
REQUIRE((i == v));
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
REQUIRE(first == 11);
|
REQUIRE((first == 11));
|
||||||
REQUIRE(last == 18);
|
REQUIRE((last == 18));
|
||||||
REQUIRE(s1 == 5);
|
REQUIRE((s1 == 5));
|
||||||
REQUIRE(s2 == 5);
|
REQUIRE((s2 == 5));
|
||||||
REQUIRE(s3 == 5);
|
REQUIRE((s3 == 5));
|
||||||
REQUIRE(len == 5);
|
REQUIRE((len == 5));
|
||||||
REQUIRE(i1 == 1);
|
REQUIRE((i1 == 1));
|
||||||
REQUIRE(i2 == 4);
|
REQUIRE((i2 == 4));
|
||||||
REQUIRE(v1 == 12);
|
REQUIRE((v1 == 12));
|
||||||
REQUIRE(v2 == 15);
|
REQUIRE((v2 == 15));
|
||||||
REQUIRE(v3 == 14);
|
REQUIRE((v3 == 14));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("containers/sequence containers", "check all of the functinos for every single container") {
|
TEST_CASE("containers/sequence containers", "check all of the functinos for every single container") {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user