mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Additions for gitignore for the new files that are necessary to kick around qtCreator
Fix for userdata to accept base classes where the derived class uses the name of a base member function to access it (Derived::get_num, where get_num is only implemented in Base::get_num) VC++ makes this acceptance easy by taking the name as "Derived", but GCC and Clang
This commit is contained in:
parent
b68a57c65c
commit
41e1ca2baa
6
.gitignore
vendored
6
.gitignore
vendored
@ -18,3 +18,9 @@ liblua.a
|
|||||||
sol/include/
|
sol/include/
|
||||||
.ninja*
|
.ninja*
|
||||||
include/
|
include/
|
||||||
|
lib/liblua5.2.a
|
||||||
|
*.config
|
||||||
|
*.creator
|
||||||
|
*.files
|
||||||
|
*.includes
|
||||||
|
main.cpp
|
||||||
|
@ -110,8 +110,9 @@ private:
|
|||||||
template<std::size_t N>
|
template<std::size_t N>
|
||||||
void build_function_tables() {}
|
void build_function_tables() {}
|
||||||
|
|
||||||
template<std::size_t N, typename... Args, typename Ret>
|
template<std::size_t N, typename... Args, typename TBase, typename Ret>
|
||||||
void build_function_tables(std::string name, Ret T::* func, Args&&... args) {
|
void build_function_tables(std::string name, Ret TBase::* func, Args&&... args) {
|
||||||
|
static_assert(std::is_base_of<TBase, T>::value, "Any registered function must be part of the class");
|
||||||
typedef typename std::decay<decltype(func)>::type function_type;
|
typedef typename std::decay<decltype(func)>::type function_type;
|
||||||
functionnames.push_back(std::move(name));
|
functionnames.push_back(std::move(name));
|
||||||
functions.emplace_back(detail::make_unique<userdata_function<function_type, T>>(std::move(func)));
|
functions.emplace_back(detail::make_unique<userdata_function<function_type, T>>(std::move(func)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user