mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Merge remote-tracking branch 'origin/develop' into sol3
# Conflicts: # include/single/sol/sol.hpp # include/single/sol/sol_forward.hpp
This commit is contained in:
commit
f75d335988
|
@ -92,7 +92,7 @@ If you don't specify any constructor options at all and the type is `default_con
|
|||
- If you pass the ``constructors<...>`` argument first when constructing the usertype, then it will automatically be given a ``"{name}"`` of ``"new"``
|
||||
* ``"{name}", sol::initializers( func1, func2, ... )``
|
||||
- Used to handle *initializer functions* that need to initialize the memory itself (but not actually allocate the memory, since that comes as a userdata block from Lua)
|
||||
- Given one or more functions, provides an overloaded Lua function for creating a the specified type
|
||||
- Given one or more functions, provides an overloaded Lua function for creating the specified type
|
||||
+ The function must have the argument signature ``func( T*, Arguments... )`` or ``func( T&, Arguments... )``, where the pointer or reference will point to a place of allocated memory that has an uninitialized ``T``. Note that Lua controls the memory, so performing a ``new`` and setting it to the ``T*`` or ``T&`` is a bad idea: instead, use ``placement new`` to invoke a constructor, or deal with the memory exactly as you see fit
|
||||
* ``{anything}, sol::factories( func1, func2, ... )``
|
||||
- Used to indicate that a factory function (e.g., something that produces a ``std::unique_ptr<T, ...>``, ``std::shared_ptr<T>``, ``T``, or similar) will be creating the object type
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace sol {
|
|||
|
||||
template <typename... Ret, typename... Args>
|
||||
decltype(auto) call(Args&&... args) {
|
||||
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 191200000
|
||||
#if !defined(__clang__) && defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 191200000
|
||||
// MSVC is ass sometimes
|
||||
return get<protected_function>().call<Ret...>(std::forward<Args>(args)...);
|
||||
#else
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace sol {
|
|||
|
||||
template <typename... Ret, typename... Args>
|
||||
decltype(auto) call(Args&&... args) {
|
||||
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 191200000
|
||||
#if !defined(__clang__) && defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 191200000
|
||||
// MSVC is ass sometimes
|
||||
return get<function>().call<Ret...>(std::forward<Args>(args)...);
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue
Block a user