Skip to content

Commit c1f95a7

Browse files
committed
🛠️ miscellaneous fixes
1 parent 309f8dd commit c1f95a7

File tree

8 files changed

+26
-17
lines changed

8 files changed

+26
-17
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -124,32 +124,32 @@ You will need any flavor of python3 and an available compiler. The testing suite
124124
"A Sun For the Moon - A Zero-Overhead Lua Abstraction using C++"
125125
ThePhD
126126
Lua Workshop 2016 - Mashape, San Francisco, CA
127-
[Deck](https://github.com/ThePhD/sol2/blob/develop/docs/presentations/2016.10.14%20-%20ThePhD%20-%20No%20Overhead%20C%20Abstraction.pdf)
127+
[Deck](https://github.com/ThePhD/sol2/blob/develop/documentation/presentation/2016.10.14%20-%20ThePhD%20-%20No%20Overhead%20C%20Abstraction.pdf)
128128
129129
"Wrapping Lua C in C++ - Efficiently, Nicely, and with a Touch of Magic"
130130
ThePhD
131131
Boston C++ Meetup November 2017 - CiC (Milk Street), Boston, MA
132-
[Deck](https://github.com/ThePhD/sol2/blob/develop/docs/presentations/2017.11.08%20-%20ThePhD%20-%20Wrapping%20Lua%20C%20in%20C%2B%2B.pdf)
132+
[Deck](https://github.com/ThePhD/sol2/blob/develop/documentation/presentation/2017.11.08%20-%20ThePhD%20-%20Wrapping%20Lua%20C%20in%20C%2B%2B.pdf)
133133
134134
"Biting the CMake Bullet"
135135
ThePhD
136136
Boston C++ Meetup February 2018 - CiC (Main Street), Cambridge, MA
137-
[Deck](https://github.com/ThePhD/sol2/blob/develop/docs/presentations/2018.02.06%20-%20ThePhD%20-%20Biting%20the%20CMake%20Bullet.pdf)
137+
[Deck](https://github.com/ThePhD/sol2/blob/develop/documentation/presentation/2018.02.06%20-%20ThePhD%20-%20Biting%20the%20CMake%20Bullet.pdf)
138138
139139
"Compile Fast, Run Faster, Scale Forever: A look into the sol2 Library"
140140
ThePhD
141141
C++Now 2018 - Hudson Commons, Aspen Physics Center, Aspen, Colorado
142-
[Deck](https://github.com/ThePhD/sol2/blob/develop/docs/presentations/2018.05.10%20-%20ThePhD%20-%20Compile%20Fast%2C%20Run%20Faster%2C%20Scale%20Forever.pdf)
142+
[Deck](https://github.com/ThePhD/sol2/blob/develop/documentation/presentation/2018.05.10%20-%20ThePhD%20-%20Compile%20Fast%2C%20Run%20Faster%2C%20Scale%20Forever.pdf)
143143
144144
"Scripting at the Speed of Thought: Using Lua in C++ with sol2"
145145
ThePhD
146146
CppCon 2018 - 404 Keystone, Meydenbauer Center, Aspen, Colorado
147-
[Deck](https://github.com/ThePhD/sol2/blob/develop/docs/presentations/2018.09.28%20-%20ThePhD%20-%20Scripting%20at%20the%20Speed%20of%20Thought.pdf)
147+
[Deck](https://github.com/ThePhD/sol2/blob/develop/documentation/presentation/2018.09.28%20-%20ThePhD%20-%20Scripting%20at%20the%20Speed%20of%20Thought.pdf)
148148
149149
"The Plan for Tomorrow: Compile-Time Extension Points in C++"
150150
ThePhD
151151
C++Now 2019 - Flug Auditorium, Aspen Physics Center, Aspen, Colorado
152-
[Deck](https://github.com/ThePhD/sol2/blob/develop/docs/presentations/2019.05.10%20-%20ThePhD%20-%20The%20Plan%20for%20Tomorrow%20-%20Compile-Time%20Extension%20Points%20in%20C%2b%2b.pdf)
152+
[Deck](https://github.com/ThePhD/sol2/blob/develop/documentation/presentation/2019.05.10%20-%20ThePhD%20-%20The%20Plan%20for%20Tomorrow%20-%20Compile-Time%20Extension%20Points%20in%20C%2b%2b.pdf)
153153
154154
155155

cmake/Packages/FindLuaBuild/LuaVanilla.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ if (LUA_LOCAL_DIR)
170170
add_custom_target(LUA_VANILLA
171171
DEPENDS "${LUA_VANILLA_LIB_SOURCES}" "${LUA_VANILLA_LUA_SOURCES}")
172172
set(LUA_VANILLA_INCLUDE_DIRS ${LUA_VANILLA_INCLUDE_DIRS} "${LUA_VANILLA_SOURCE_DIR}/include")
173+
set(LUA_VANILLA_INCLUDE_DIRS ${LUA_VANILLA_INCLUDE_DIRS} "${LUA_VANILLA_SOURCE_DIR}/src")
173174
else()
174175
include(FetchContent)
175176
FetchContent_Declare(

include/sol/optional_implementation.hpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -2186,12 +2186,9 @@ namespace sol {
21862186
/// one.
21872187
///
21882188
/// \group emplace
2189-
template <class... Args>
2190-
T& emplace(Args&&... args) noexcept {
2191-
static_assert(std::is_constructible<T, Args&&...>::value, "T must be constructible with Args");
2192-
2189+
T& emplace(T& arg) noexcept {
21932190
*this = nullopt;
2194-
new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...);
2191+
m_value = &arg;
21952192
return **this;
21962193
}
21972194

include/sol/protected_function_result.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace sol {
5656

5757
protected_function_result() noexcept : protected_function_result(nullptr) {}
5858
protected_function_result(lua_State* Ls, int idx = -1, int retnum = 0, int popped = 0, call_status pferr = call_status::ok) noexcept
59-
: L(Ls), index(idx), returncount(retnum), popcount(popped), err(pferr) {
59+
: L( Ls), index(idx), returncount(retnum), popcount(popped), err(pferr) {
6060
}
6161

6262
// We do not want anyone to copy these around willy-nilly

include/sol/variadic_results.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ namespace sol {
6161

6262
basic_variadic_results(const basic_variadic_results&) = default;
6363
basic_variadic_results(basic_variadic_results&&) = default;
64+
basic_variadic_results& operator=(const basic_variadic_results&) = default;
65+
basic_variadic_results& operator=(basic_variadic_results&&) = default;
6466
};
6567

6668
struct variadic_results : public basic_variadic_results<> {

meson.build

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ else
77
lua_cpp = 'false'
88
endif
99

10-
lua_dep = dependency('lua', fallback: [ 'lua', 'lua_dep' ], default_options: [ 'lua_cpp=' + lua_cpp ])
10+
if get_option('use_luajit')
11+
luadep_name = 'luajit'
12+
luadep_options = []
13+
lua_cpp = 'false'
14+
else
15+
luadep_name = 'lua'
16+
luadep_options = [ 'lua_cpp=' + lua_cpp ]
17+
endif
18+
lua_dep = dependency(luadep_name, fallback: [ luadep_name, luadep_name + '_dep' ], default_options: luadep_options)
1119

1220
# Set compiler flags if we're compiling lua as C++.
1321
compile_args = []

meson_options.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
option('single', type: 'boolean', value: false, description: 'Generate the sol2 single header and expose the corresponding build targets')
2-
option('lua_cpp', type: 'boolean', value: false, description: 'Compile lua as C++ code')
2+
option('lua_cpp', type: 'boolean', value: false, description: 'Compile lua as C++ code')
3+
option('use_luajit', type: 'boolean', value: false, description: 'Search for luajit dep, implies lua_cpp=false')

tests/coroutines/source/array_proxy_lifetime.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ inline namespace sol2_regression_test_coroutines_array_proxy_lifetime {
4848
using iterator_category = std::random_access_iterator_tag;
4949
using difference_type = std::ptrdiff_t;
5050
using value_type = std::weak_ptr<A>;
51-
using pointer = std::weak_ptr<A>*; // or also value_type*
52-
using reference = std::weak_ptr<A>&; // or also value_type&
51+
using pointer = std::weak_ptr<A>*;
52+
using reference = std::weak_ptr<A>&;
5353

5454
const ArrayProxy& a;
5555
size_t index;
@@ -59,7 +59,7 @@ inline namespace sol2_regression_test_coroutines_array_proxy_lifetime {
5959

6060
value_type operator*() const {
6161
size_t size = a.mpParent.children.size();
62-
if (index >= 0 && index < size) {
62+
if (index < size) {
6363
return a.mpParent.children[index];
6464
}
6565
return std::weak_ptr<A>();

0 commit comments

Comments
 (0)