Fix Lua bindings for C++17/C++20 -- #8683
std::list/vector/map declarations change, requiring explicit cast to avoid FuncTraits ambiguities.
This commit is contained in:
parent
8b888282fa
commit
115c79874a
|
@ -1839,8 +1839,8 @@ public:
|
|||
|
||||
return beginClass<LT> (name)
|
||||
.addVoidConstructor ()
|
||||
.addFunction ("empty", <::empty)
|
||||
.addFunction ("size", <::size)
|
||||
.addFunction ("empty", (bool (LT::*)()const)<::empty)
|
||||
.addFunction ("size", (T_SIZE (LT::*)()const)<::size)
|
||||
.addFunction ("clear", (void (LT::*)())<::clear)
|
||||
.addFunction ("count", (T_SIZE (LT::*)(const K&) const)<::count)
|
||||
.addExtCFunction ("add", &CFunc::tableToMap<K, V>)
|
||||
|
@ -1870,11 +1870,11 @@ public:
|
|||
.addVoidConstructor ()
|
||||
.addFunction ("reset", (BS& (BS::*)())&BS::reset)
|
||||
.addFunction ("set", (BS& (BS::*)(size_t, bool))&BS::set)
|
||||
.addFunction ("count", &BS::count)
|
||||
.addFunction ("any", &BS::any)
|
||||
.addFunction ("none", &BS::none)
|
||||
.addFunction ("count", (size_t (BS::*)()const)&BS::count)
|
||||
.addFunction ("size", (size_t (BS::*)()const)&BS::size)
|
||||
.addFunction ("any", (bool (BS::*)()const)&BS::any)
|
||||
.addFunction ("none", (bool (BS::*)()const)&BS::none)
|
||||
.addFunction ("test", &BS::test)
|
||||
.addFunction ("size", &BS::size)
|
||||
.addExtCFunction ("add", &CFunc::tableToBitSet<T>)
|
||||
.addExtCFunction ("table", &CFunc::bitSetToTable<T>);
|
||||
}
|
||||
|
@ -1883,11 +1883,12 @@ public:
|
|||
Class<std::list<T> > beginConstStdList (char const* name)
|
||||
{
|
||||
typedef std::list<T> LT;
|
||||
typedef typename LT::size_type T_SIZE;
|
||||
return beginClass<LT> (name)
|
||||
.addVoidConstructor ()
|
||||
.addFunction ("empty", <::empty)
|
||||
.addFunction ("size", <::size)
|
||||
.addFunction ("reverse", <::reverse)
|
||||
.addFunction ("empty", static_cast<bool (LT::*)() const>(<::empty))
|
||||
.addFunction ("size", static_cast<T_SIZE (LT::*)() const>(<::size))
|
||||
.addFunction ("reverse", static_cast<void (LT::*)()>(<::reverse))
|
||||
.addFunction ("front", static_cast<T& (LT::*)()>(<::front))
|
||||
.addFunction ("back", static_cast<T& (LT::*)()>(<::back))
|
||||
.addExtCFunction ("iter", &CFunc::listIter<T, LT>)
|
||||
|
@ -1898,10 +1899,15 @@ public:
|
|||
Class<std::list<T> > beginStdList (char const* name)
|
||||
{
|
||||
typedef std::list<T> LT;
|
||||
typedef typename LT::size_type T_SIZE;
|
||||
return beginConstStdList<T> (name)
|
||||
#if !defined(_MSC_VER) || (_MSC_VER < 1900)
|
||||
/* std::list::unique() got broken in later versions of MSVC */
|
||||
# if (defined(__cplusplus) && __cplusplus >= 201709L)
|
||||
.addFunction ("unique", (T_SIZE (LT::*)())<::unique)
|
||||
# else
|
||||
.addFunction ("unique", (void (LT::*)())<::unique)
|
||||
# endif
|
||||
#endif
|
||||
.addFunction ("push_back", (void (LT::*)(const T&))<::push_back)
|
||||
.addExtCFunction ("add", &CFunc::tableToList<T, LT>);
|
||||
|
@ -1912,11 +1918,12 @@ public:
|
|||
{
|
||||
typedef T* TP;
|
||||
typedef std::list<TP> LT;
|
||||
typedef typename LT::size_type T_SIZE;
|
||||
return beginClass<LT> (name)
|
||||
.addVoidConstructor ()
|
||||
.addFunction ("empty", <::empty)
|
||||
.addFunction ("size", <::size)
|
||||
.addFunction ("reverse", <::reverse)
|
||||
.addFunction ("empty", static_cast<bool (LT::*)() const>(<::empty))
|
||||
.addFunction ("size", static_cast<T_SIZE (LT::*)() const>(<::size))
|
||||
.addFunction ("reverse", static_cast<void (LT::*)()>(<::reverse))
|
||||
.addFunction ("front", static_cast<const TP& (LT::*)() const>(<::front))
|
||||
.addFunction ("back", static_cast<const TP& (LT::*)() const>(<::back))
|
||||
.addExtCFunction ("iter", &CFunc::listIter<T*, LT>)
|
||||
|
@ -1928,10 +1935,15 @@ public:
|
|||
{
|
||||
typedef T* TP;
|
||||
typedef std::list<TP> LT;
|
||||
typedef typename LT::size_type T_SIZE;
|
||||
return beginConstStdCPtrList<T> (name)
|
||||
#if !defined(_MSC_VER) || (_MSC_VER < 1900)
|
||||
/* std::list::unique() got broken in later versions of MSVC */
|
||||
# if (defined(__cplusplus) && __cplusplus >= 201709L)
|
||||
.addFunction ("unique", (T_SIZE (LT::*)())<::unique)
|
||||
# else
|
||||
.addFunction ("unique", (void (LT::*)())<::unique)
|
||||
# endif
|
||||
#endif
|
||||
.addExtCFunction ("push_back", &CFunc::pushbackptr<T, LT>);
|
||||
}
|
||||
|
@ -1946,8 +1958,8 @@ public:
|
|||
|
||||
return beginClass<LT> (name)
|
||||
.addVoidConstructor ()
|
||||
.addFunction ("empty", <::empty)
|
||||
.addFunction ("size", <::size)
|
||||
.addFunction ("empty", (bool (LT::*)()const)<::empty)
|
||||
.addFunction ("size", (T_SIZE (LT::*)()const)<::size)
|
||||
.addFunction ("at", (T_REF (LT::*)(T_SIZE))<::at)
|
||||
.addExtCFunction ("iter", &CFunc::listIter<T, LT>)
|
||||
.addExtCFunction ("table", &CFunc::listToTable<T, LT>);
|
||||
|
@ -1971,14 +1983,19 @@ public:
|
|||
Class<boost::shared_ptr<std::list<T> > > beginPtrStdList (char const* name)
|
||||
{
|
||||
typedef std::list<T> LT;
|
||||
typedef typename LT::size_type T_SIZE;
|
||||
return beginClass<boost::shared_ptr<LT> > (name)
|
||||
//.addVoidPtrConstructor<LT> ()
|
||||
.addPtrFunction ("empty", <::empty)
|
||||
.addPtrFunction ("size", <::size)
|
||||
.addPtrFunction ("reverse", <::reverse)
|
||||
.addPtrFunction ("empty", (bool (LT::*)()const)<::empty)
|
||||
.addPtrFunction ("size", (T_SIZE (LT::*)()const)<::size)
|
||||
.addPtrFunction ("reverse", (void (LT::*)())<::reverse)
|
||||
#if !defined(_MSC_VER) || (_MSC_VER < 1900)
|
||||
/* std::list::unique() got broken in later versions of MSVC */
|
||||
# if (defined(__cplusplus) && __cplusplus >= 201709L)
|
||||
.addPtrFunction ("unique", (T_SIZE (LT::*)())<::unique)
|
||||
# else
|
||||
.addPtrFunction ("unique", (void (LT::*)())<::unique)
|
||||
# endif
|
||||
#endif
|
||||
.addPtrFunction ("push_back", (void (LT::*)(const T&))<::push_back)
|
||||
.addExtCFunction ("add", &CFunc::ptrTableToList<T, LT>)
|
||||
|
@ -1995,9 +2012,8 @@ public:
|
|||
|
||||
return beginClass<boost::shared_ptr<LT> > (name)
|
||||
//.addVoidPtrConstructor<LT> ()
|
||||
.addPtrFunction ("empty", <::empty)
|
||||
.addPtrFunction ("empty", <::empty)
|
||||
.addPtrFunction ("size", <::size)
|
||||
.addPtrFunction ("empty", (bool (LT::*)()const)<::empty)
|
||||
.addPtrFunction ("size", (T_SIZE (LT::*)()const)<::size)
|
||||
.addPtrFunction ("push_back", (void (LT::*)(const T&))<::push_back)
|
||||
.addPtrFunction ("at", (T_REF (LT::*)(T_SIZE))<::at)
|
||||
.addExtCFunction ("add", &CFunc::ptrTableToList<T, LT>)
|
||||
|
|
Loading…
Reference in New Issue
Block a user