mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Handle qualified name failures of VC++, where using
templates do not match the fully qualified names of what they alias to (Thanks, VC++)
This commit is contained in:
parent
7eccb5883e
commit
34b81bef6b
|
@ -13,7 +13,7 @@ The guidelines for reporting a bug are relatively simple and are as follows:
|
||||||
2. Make a descriptive title that summarises the bug as a whole.
|
2. Make a descriptive title that summarises the bug as a whole.
|
||||||
3. Explain the bug in as much detail as you can in the body of the issue.
|
3. Explain the bug in as much detail as you can in the body of the issue.
|
||||||
|
|
||||||
If you have all of those requirements set, then your issue reporting is golden.
|
If you have all of those requirements set, then your issue reporting is golden.
|
||||||
|
|
||||||
## Submitting a pull request
|
## Submitting a pull request
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2013-2016 Rapptz, ThePhD, and contributors
|
Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -25,7 +25,7 @@ os.chdir(script_path)
|
||||||
|
|
||||||
intro = """// The MIT License (MIT)
|
intro = """// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
@ -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-05-09 17:31:19.874339 UTC
|
// Generated 2017-05-15 14:41:13.667703 UTC
|
||||||
// This header was generated with sol v2.17.2 (revision 8efafca)
|
// This header was generated with sol v2.17.3 (revision 7eccb58)
|
||||||
// https://github.com/ThePhD/sol2
|
// https://github.com/ThePhD/sol2
|
||||||
|
|
||||||
#ifndef SOL_SINGLE_INCLUDE_HPP
|
#ifndef SOL_SINGLE_INCLUDE_HPP
|
||||||
|
@ -2945,6 +2945,12 @@ namespace sol {
|
||||||
const nullopt_t nullopt = boost::none;
|
const nullopt_t nullopt = boost::none;
|
||||||
#endif // Boost vs. Better optional
|
#endif // Boost vs. Better optional
|
||||||
|
|
||||||
|
namespace meta {
|
||||||
|
template <typename T>
|
||||||
|
struct is_optional : std::false_type {};
|
||||||
|
template <typename T>
|
||||||
|
struct is_optional<optional<T>> : std::true_type {};
|
||||||
|
} // meta
|
||||||
} // sol
|
} // sol
|
||||||
|
|
||||||
// end of sol/optional.hpp
|
// end of sol/optional.hpp
|
||||||
|
@ -9712,11 +9718,11 @@ namespace sol {
|
||||||
call_status err;
|
call_status err;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
decltype(auto) tagged_get(types<sol::optional<T>>) const {
|
decltype(auto) tagged_get(types<optional<T>>) const {
|
||||||
if (!valid()) {
|
if (!valid()) {
|
||||||
return sol::optional<T>(nullopt);
|
return optional<T>(nullopt);
|
||||||
}
|
}
|
||||||
return stack::get<sol::optional<T>>(L, index);
|
return stack::get<optional<T>>(L, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -10421,7 +10427,7 @@ namespace sol {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
decltype(auto) get_or(T&& otherwise) const {
|
decltype(auto) get_or(T&& otherwise) const {
|
||||||
typedef decltype(get<T>()) U;
|
typedef decltype(get<T>()) U;
|
||||||
sol::optional<U> option = get<sol::optional<U>>();
|
optional<U> option = get<optional<U>>();
|
||||||
if (option) {
|
if (option) {
|
||||||
return static_cast<U>(option.value());
|
return static_cast<U>(option.value());
|
||||||
}
|
}
|
||||||
|
@ -10430,7 +10436,7 @@ namespace sol {
|
||||||
|
|
||||||
template<typename T, typename D>
|
template<typename T, typename D>
|
||||||
decltype(auto) get_or(D&& otherwise) const {
|
decltype(auto) get_or(D&& otherwise) const {
|
||||||
sol::optional<T> option = get<sol::optional<T>>();
|
optional<T> option = get<optional<T>>();
|
||||||
if (option) {
|
if (option) {
|
||||||
return static_cast<T>(option.value());
|
return static_cast<T>(option.value());
|
||||||
}
|
}
|
||||||
|
@ -10765,7 +10771,7 @@ namespace sol {
|
||||||
if (is_simple) {
|
if (is_simple) {
|
||||||
simple_map& sm = stack::get<user<simple_map>>(L, upvalue_index(1));
|
simple_map& sm = stack::get<user<simple_map>>(L, upvalue_index(1));
|
||||||
function_map& functions = sm.functions;
|
function_map& functions = sm.functions;
|
||||||
sol::optional<std::string> maybeaccessor = stack::get<sol::optional<std::string>>(L, 2);
|
optional<std::string> maybeaccessor = stack::get<optional<std::string>>(L, 2);
|
||||||
if (!maybeaccessor) {
|
if (!maybeaccessor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -10783,7 +10789,7 @@ namespace sol {
|
||||||
bool mustindex = umc.mustindex;
|
bool mustindex = umc.mustindex;
|
||||||
if (!mustindex)
|
if (!mustindex)
|
||||||
return;
|
return;
|
||||||
sol::optional<std::string> maybeaccessor = stack::get<sol::optional<std::string>>(L, 2);
|
optional<std::string> maybeaccessor = stack::get<optional<std::string>>(L, 2);
|
||||||
if (!maybeaccessor) {
|
if (!maybeaccessor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -12562,15 +12568,15 @@ namespace sol {
|
||||||
-> decltype(stack::pop<std::tuple<Ret0, Ret1, Ret...>>(nullptr)) {
|
-> decltype(stack::pop<std::tuple<Ret0, Ret1, Ret...>>(nullptr)) {
|
||||||
typedef decltype(stack::pop<std::tuple<Ret0, Ret1, Ret...>>(nullptr)) Tup;
|
typedef decltype(stack::pop<std::tuple<Ret0, Ret1, Ret...>>(nullptr)) Tup;
|
||||||
return Tup(
|
return Tup(
|
||||||
traverse_get_optional<top_level, Ret0>(meta::is_specialization_of<sol::optional, meta::unqualified_t<Ret0>>(), detail::forward_get<0>(keys)),
|
traverse_get_optional<top_level, Ret0>(meta::is_optional<meta::unqualified_t<Ret0>>(), detail::forward_get<0>(keys)),
|
||||||
traverse_get_optional<top_level, Ret1>(meta::is_specialization_of<sol::optional, meta::unqualified_t<Ret1>>(), detail::forward_get<1>(keys)),
|
traverse_get_optional<top_level, Ret1>(meta::is_optional<meta::unqualified_t<Ret1>>(), detail::forward_get<1>(keys)),
|
||||||
traverse_get_optional<top_level, Ret>(meta::is_specialization_of<sol::optional, meta::unqualified_t<Ret>>(), detail::forward_get<I>(keys))...
|
traverse_get_optional<top_level, Ret>(meta::is_optional<meta::unqualified_t<Ret>>(), detail::forward_get<I>(keys))...
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Ret, std::size_t I, typename Keys>
|
template<typename Ret, std::size_t I, typename Keys>
|
||||||
decltype(auto) tuple_get(types<Ret>, std::index_sequence<I>, Keys&& keys) const {
|
decltype(auto) tuple_get(types<Ret>, std::index_sequence<I>, Keys&& keys) const {
|
||||||
return traverse_get_optional<top_level, Ret>(meta::is_specialization_of<sol::optional, meta::unqualified_t<Ret>>(), detail::forward_get<I>(keys));
|
return traverse_get_optional<top_level, Ret>(meta::is_optional<meta::unqualified_t<Ret>>(), detail::forward_get<I>(keys));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Pairs, std::size_t... I>
|
template<typename Pairs, std::size_t... I>
|
||||||
|
@ -12711,7 +12717,7 @@ namespace sol {
|
||||||
template<typename T, typename Key>
|
template<typename T, typename Key>
|
||||||
decltype(auto) get_or(Key&& key, T&& otherwise) const {
|
decltype(auto) get_or(Key&& key, T&& otherwise) const {
|
||||||
typedef decltype(get<T>("")) U;
|
typedef decltype(get<T>("")) U;
|
||||||
sol::optional<U> option = get<sol::optional<U>>(std::forward<Key>(key));
|
optional<U> option = get<optional<U>>(std::forward<Key>(key));
|
||||||
if (option) {
|
if (option) {
|
||||||
return static_cast<U>(option.value());
|
return static_cast<U>(option.value());
|
||||||
}
|
}
|
||||||
|
@ -12720,7 +12726,7 @@ namespace sol {
|
||||||
|
|
||||||
template<typename T, typename Key, typename D>
|
template<typename T, typename Key, typename D>
|
||||||
decltype(auto) get_or(Key&& key, D&& otherwise) const {
|
decltype(auto) get_or(Key&& key, D&& otherwise) const {
|
||||||
sol::optional<T> option = get<sol::optional<T>>(std::forward<Key>(key));
|
optional<T> option = get<optional<T>>(std::forward<Key>(key));
|
||||||
if (option) {
|
if (option) {
|
||||||
return static_cast<T>(option.value());
|
return static_cast<T>(option.value());
|
||||||
}
|
}
|
||||||
|
@ -12730,7 +12736,7 @@ namespace sol {
|
||||||
template <typename T, typename... Keys>
|
template <typename T, typename... Keys>
|
||||||
decltype(auto) traverse_get(Keys&&... keys) const {
|
decltype(auto) traverse_get(Keys&&... keys) const {
|
||||||
auto pp = stack::push_pop<is_global<Keys...>::value>(*this);
|
auto pp = stack::push_pop<is_global<Keys...>::value>(*this);
|
||||||
return traverse_get_optional<top_level, T>(meta::is_specialization_of<sol::optional, meta::unqualified_t<T>>(), std::forward<Keys>(keys)...);
|
return traverse_get_optional<top_level, T>(meta::is_optional<meta::unqualified_t<T>>(), std::forward<Keys>(keys)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Keys>
|
template <typename... Keys>
|
||||||
|
@ -13164,11 +13170,11 @@ namespace sol {
|
||||||
load_status err;
|
load_status err;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
decltype(auto) tagged_get(types<sol::optional<T>>) const {
|
decltype(auto) tagged_get(types<optional<T>>) const {
|
||||||
if (!valid()) {
|
if (!valid()) {
|
||||||
return sol::optional<T>(nullopt);
|
return optional<T>(nullopt);
|
||||||
}
|
}
|
||||||
return stack::get<sol::optional<T>>(L, index);
|
return stack::get<optional<T>>(L, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -13181,20 +13187,20 @@ namespace sol {
|
||||||
return stack::get<T>(L, index);
|
return stack::get<T>(L, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
sol::optional<sol::error> tagged_get(types<sol::optional<sol::error>>) const {
|
optional<error> tagged_get(types<optional<error>>) const {
|
||||||
if (valid()) {
|
if (valid()) {
|
||||||
return nullopt;
|
return nullopt;
|
||||||
}
|
}
|
||||||
return sol::error(detail::direct_error, stack::get<std::string>(L, index));
|
return error(detail::direct_error, stack::get<std::string>(L, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
sol::error tagged_get(types<sol::error>) const {
|
error tagged_get(types<error>) const {
|
||||||
#ifdef SOL_CHECK_ARGUMENTS
|
#ifdef SOL_CHECK_ARGUMENTS
|
||||||
if (valid()) {
|
if (valid()) {
|
||||||
type_panic(L, index, type_of(L, index), type::none);
|
type_panic(L, index, type_of(L, index), type::none);
|
||||||
}
|
}
|
||||||
#endif // Check Argument Safety
|
#endif // Check Argument Safety
|
||||||
return sol::error(detail::direct_error, stack::get<std::string>(L, index));
|
return error(detail::direct_error, stack::get<std::string>(L, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
2
sol.hpp
2
sol.hpp
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
@ -37,11 +37,11 @@ namespace sol {
|
||||||
load_status err;
|
load_status err;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
decltype(auto) tagged_get(types<sol::optional<T>>) const {
|
decltype(auto) tagged_get(types<optional<T>>) const {
|
||||||
if (!valid()) {
|
if (!valid()) {
|
||||||
return sol::optional<T>(nullopt);
|
return optional<T>(nullopt);
|
||||||
}
|
}
|
||||||
return stack::get<sol::optional<T>>(L, index);
|
return stack::get<optional<T>>(L, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -54,20 +54,20 @@ namespace sol {
|
||||||
return stack::get<T>(L, index);
|
return stack::get<T>(L, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
sol::optional<sol::error> tagged_get(types<sol::optional<sol::error>>) const {
|
optional<error> tagged_get(types<optional<error>>) const {
|
||||||
if (valid()) {
|
if (valid()) {
|
||||||
return nullopt;
|
return nullopt;
|
||||||
}
|
}
|
||||||
return sol::error(detail::direct_error, stack::get<std::string>(L, index));
|
return error(detail::direct_error, stack::get<std::string>(L, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
sol::error tagged_get(types<sol::error>) const {
|
error tagged_get(types<error>) const {
|
||||||
#ifdef SOL_CHECK_ARGUMENTS
|
#ifdef SOL_CHECK_ARGUMENTS
|
||||||
if (valid()) {
|
if (valid()) {
|
||||||
type_panic(L, index, type_of(L, index), type::none);
|
type_panic(L, index, type_of(L, index), type::none);
|
||||||
}
|
}
|
||||||
#endif // Check Argument Safety
|
#endif // Check Argument Safety
|
||||||
return sol::error(detail::direct_error, stack::get<std::string>(L, index));
|
return error(detail::direct_error, stack::get<std::string>(L, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
@ -39,6 +39,12 @@ namespace sol {
|
||||||
const nullopt_t nullopt = boost::none;
|
const nullopt_t nullopt = boost::none;
|
||||||
#endif // Boost vs. Better optional
|
#endif // Boost vs. Better optional
|
||||||
|
|
||||||
|
namespace meta {
|
||||||
|
template <typename T>
|
||||||
|
struct is_optional : std::false_type {};
|
||||||
|
template <typename T>
|
||||||
|
struct is_optional<optional<T>> : std::true_type {};
|
||||||
|
} // meta
|
||||||
} // sol
|
} // sol
|
||||||
|
|
||||||
#endif // SOL_OPTIONAL_HPP
|
#endif // SOL_OPTIONAL_HPP
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
@ -38,11 +38,11 @@ namespace sol {
|
||||||
call_status err;
|
call_status err;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
decltype(auto) tagged_get(types<sol::optional<T>>) const {
|
decltype(auto) tagged_get(types<optional<T>>) const {
|
||||||
if (!valid()) {
|
if (!valid()) {
|
||||||
return sol::optional<T>(nullopt);
|
return optional<T>(nullopt);
|
||||||
}
|
}
|
||||||
return stack::get<sol::optional<T>>(L, index);
|
return stack::get<optional<T>>(L, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
@ -81,7 +81,7 @@ namespace sol {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
decltype(auto) get_or(T&& otherwise) const {
|
decltype(auto) get_or(T&& otherwise) const {
|
||||||
typedef decltype(get<T>()) U;
|
typedef decltype(get<T>()) U;
|
||||||
sol::optional<U> option = get<sol::optional<U>>();
|
optional<U> option = get<optional<U>>();
|
||||||
if (option) {
|
if (option) {
|
||||||
return static_cast<U>(option.value());
|
return static_cast<U>(option.value());
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ namespace sol {
|
||||||
|
|
||||||
template<typename T, typename D>
|
template<typename T, typename D>
|
||||||
decltype(auto) get_or(D&& otherwise) const {
|
decltype(auto) get_or(D&& otherwise) const {
|
||||||
sol::optional<T> option = get<sol::optional<T>>();
|
optional<T> option = get<optional<T>>();
|
||||||
if (option) {
|
if (option) {
|
||||||
return static_cast<T>(option.value());
|
return static_cast<T>(option.value());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
@ -79,15 +79,15 @@ namespace sol {
|
||||||
-> decltype(stack::pop<std::tuple<Ret0, Ret1, Ret...>>(nullptr)) {
|
-> decltype(stack::pop<std::tuple<Ret0, Ret1, Ret...>>(nullptr)) {
|
||||||
typedef decltype(stack::pop<std::tuple<Ret0, Ret1, Ret...>>(nullptr)) Tup;
|
typedef decltype(stack::pop<std::tuple<Ret0, Ret1, Ret...>>(nullptr)) Tup;
|
||||||
return Tup(
|
return Tup(
|
||||||
traverse_get_optional<top_level, Ret0>(meta::is_specialization_of<sol::optional, meta::unqualified_t<Ret0>>(), detail::forward_get<0>(keys)),
|
traverse_get_optional<top_level, Ret0>(meta::is_optional<meta::unqualified_t<Ret0>>(), detail::forward_get<0>(keys)),
|
||||||
traverse_get_optional<top_level, Ret1>(meta::is_specialization_of<sol::optional, meta::unqualified_t<Ret1>>(), detail::forward_get<1>(keys)),
|
traverse_get_optional<top_level, Ret1>(meta::is_optional<meta::unqualified_t<Ret1>>(), detail::forward_get<1>(keys)),
|
||||||
traverse_get_optional<top_level, Ret>(meta::is_specialization_of<sol::optional, meta::unqualified_t<Ret>>(), detail::forward_get<I>(keys))...
|
traverse_get_optional<top_level, Ret>(meta::is_optional<meta::unqualified_t<Ret>>(), detail::forward_get<I>(keys))...
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Ret, std::size_t I, typename Keys>
|
template<typename Ret, std::size_t I, typename Keys>
|
||||||
decltype(auto) tuple_get(types<Ret>, std::index_sequence<I>, Keys&& keys) const {
|
decltype(auto) tuple_get(types<Ret>, std::index_sequence<I>, Keys&& keys) const {
|
||||||
return traverse_get_optional<top_level, Ret>(meta::is_specialization_of<sol::optional, meta::unqualified_t<Ret>>(), detail::forward_get<I>(keys));
|
return traverse_get_optional<top_level, Ret>(meta::is_optional<meta::unqualified_t<Ret>>(), detail::forward_get<I>(keys));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Pairs, std::size_t... I>
|
template<typename Pairs, std::size_t... I>
|
||||||
|
@ -228,7 +228,7 @@ namespace sol {
|
||||||
template<typename T, typename Key>
|
template<typename T, typename Key>
|
||||||
decltype(auto) get_or(Key&& key, T&& otherwise) const {
|
decltype(auto) get_or(Key&& key, T&& otherwise) const {
|
||||||
typedef decltype(get<T>("")) U;
|
typedef decltype(get<T>("")) U;
|
||||||
sol::optional<U> option = get<sol::optional<U>>(std::forward<Key>(key));
|
optional<U> option = get<optional<U>>(std::forward<Key>(key));
|
||||||
if (option) {
|
if (option) {
|
||||||
return static_cast<U>(option.value());
|
return static_cast<U>(option.value());
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ namespace sol {
|
||||||
|
|
||||||
template<typename T, typename Key, typename D>
|
template<typename T, typename Key, typename D>
|
||||||
decltype(auto) get_or(Key&& key, D&& otherwise) const {
|
decltype(auto) get_or(Key&& key, D&& otherwise) const {
|
||||||
sol::optional<T> option = get<sol::optional<T>>(std::forward<Key>(key));
|
optional<T> option = get<optional<T>>(std::forward<Key>(key));
|
||||||
if (option) {
|
if (option) {
|
||||||
return static_cast<T>(option.value());
|
return static_cast<T>(option.value());
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ namespace sol {
|
||||||
template <typename T, typename... Keys>
|
template <typename T, typename... Keys>
|
||||||
decltype(auto) traverse_get(Keys&&... keys) const {
|
decltype(auto) traverse_get(Keys&&... keys) const {
|
||||||
auto pp = stack::push_pop<is_global<Keys...>::value>(*this);
|
auto pp = stack::push_pop<is_global<Keys...>::value>(*this);
|
||||||
return traverse_get_optional<top_level, T>(meta::is_specialization_of<sol::optional, meta::unqualified_t<T>>(), std::forward<Keys>(keys)...);
|
return traverse_get_optional<top_level, T>(meta::is_optional<meta::unqualified_t<T>>(), std::forward<Keys>(keys)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Keys>
|
template <typename... Keys>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
@ -251,7 +251,7 @@ namespace sol {
|
||||||
if (is_simple) {
|
if (is_simple) {
|
||||||
simple_map& sm = stack::get<user<simple_map>>(L, upvalue_index(1));
|
simple_map& sm = stack::get<user<simple_map>>(L, upvalue_index(1));
|
||||||
function_map& functions = sm.functions;
|
function_map& functions = sm.functions;
|
||||||
sol::optional<std::string> maybeaccessor = stack::get<sol::optional<std::string>>(L, 2);
|
optional<std::string> maybeaccessor = stack::get<optional<std::string>>(L, 2);
|
||||||
if (!maybeaccessor) {
|
if (!maybeaccessor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ namespace sol {
|
||||||
bool mustindex = umc.mustindex;
|
bool mustindex = umc.mustindex;
|
||||||
if (!mustindex)
|
if (!mustindex)
|
||||||
return;
|
return;
|
||||||
sol::optional<std::string> maybeaccessor = stack::get<sol::optional<std::string>>(L, 2);
|
optional<std::string> maybeaccessor = stack::get<optional<std::string>>(L, 2);
|
||||||
if (!maybeaccessor) {
|
if (!maybeaccessor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
Loading…
Reference in New Issue
Block a user