mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Merge branch 'develop' into sol3
# Conflicts: # single/sol/sol.hpp # single/sol/sol_forward.hpp
This commit is contained in:
commit
9306f319ef
|
@ -23,7 +23,7 @@ parser.add_argument(
|
||||||
help=
|
help=
|
||||||
'name and location of where to place file (and forward declaration file)',
|
'name and location of where to place file (and forward declaration file)',
|
||||||
metavar='file',
|
metavar='file',
|
||||||
default='sol.hpp')
|
default=['sol.hpp'])
|
||||||
parser.add_argument('--quiet', help='suppress all output', action='store_true')
|
parser.add_argument('--quiet', help='suppress all output', action='store_true')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
|
@ -340,6 +340,21 @@ namespace sol {
|
||||||
static const bool value = sizeof(test<T>(0)) == sizeof(char);
|
static const bool value = sizeof(test<T>(0)) == sizeof(char);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct has_traits_size_test {
|
||||||
|
private:
|
||||||
|
typedef std::array<char, 1> one;
|
||||||
|
typedef std::array<char, 2> two;
|
||||||
|
|
||||||
|
template <typename C>
|
||||||
|
static one test(decltype(&C::size));
|
||||||
|
template <typename C>
|
||||||
|
static two test(...);
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const bool value = sizeof(test<T>(0)) == sizeof(char);
|
||||||
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using has_clear = meta::boolean<has_clear_test<T>::value>;
|
using has_clear = meta::boolean<has_clear_test<T>::value>;
|
||||||
|
|
||||||
|
@ -383,7 +398,7 @@ namespace sol {
|
||||||
using has_traits_add = meta::boolean<has_traits_add_test<T>::value>;
|
using has_traits_add = meta::boolean<has_traits_add_test<T>::value>;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using has_traits_size = meta::has_size<T>;
|
using has_traits_size = meta::boolean<has_traits_size_test<T>::value>;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using has_traits_clear = has_clear<T>;
|
using has_traits_clear = has_clear<T>;
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace sol {
|
||||||
static void construct(T&& obj, Args&&... args) {
|
static void construct(T&& obj, Args&&... args) {
|
||||||
typedef meta::unqualified_t<T> Tu;
|
typedef meta::unqualified_t<T> Tu;
|
||||||
std::allocator<Tu> alloc{};
|
std::allocator<Tu> alloc{};
|
||||||
std::allocator_traits<std::allocator<Tu>>::construct(alloc, obj, std::forward<Args>(args)...);
|
std::allocator_traits<std::allocator<Tu>>::construct(alloc, std::forward<T>(obj), std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename... Args>
|
template <typename T, typename... Args>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <array>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user