Skip to content

Commit afc15a9

Browse files
committed
improve dynamic loading example
1 parent 7929951 commit afc15a9

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

doc/modules/ROOT/examples/shared_libs/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ message(STATUS "Building dynamic_shared loading examples")
99
# static linking
1010

1111
add_library(shared SHARED overriders.cpp tiger.cpp)
12-
target_link_libraries(shared Boost::openmethod Boost::dll)
12+
target_link_libraries(shared Boost::openmethod)
1313
set_target_properties(shared PROPERTIES ENABLE_EXPORTS ON)
1414

1515
add_executable(static static_main.cpp)

doc/modules/ROOT/examples/shared_libs/dynamic_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ auto main() -> int {
7373

7474
auto make_tiger = lib.get<Animal*()>("make_tiger");
7575
std::unique_ptr<Animal> hobbes{make_tiger()};
76-
std::cout << "Gracie meets Tiger -> " << meet(*gracie, *hobbes) << "\n";
76+
std::cout << "cow meets tiger -> " << meet(*gracie, *hobbes) << "\n";
7777
}
7878

7979
std::cout << "\nAfter unloading the shared library.\n";

doc/modules/ROOT/examples/shared_libs/indirect_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ auto main() -> int {
6565
{
6666
auto make_tiger = lib.get<Animal*()>("make_tiger");
6767
std::unique_ptr<Animal> hobbes{make_tiger()};
68-
std::cout << "Gracie meets Tiger -> " << meet(*gracie, *hobbes) << "\n";
68+
std::cout << "cow meets tiger -> " << meet(*gracie, *hobbes) << "\n";
6969
}
7070

7171
std::cout << "\nAfter unloading the shared library.\n";

include/boost/openmethod/core.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,7 +2235,7 @@ class method<Id, ReturnType(Parameters...), Registry>
22352235

22362236
type_id vp_type_ids[Arity];
22372237

2238-
static std::size_t slots_strides[2 * Arity - 1];
2238+
std::size_t slots_strides[2 * Arity - 1];
22392239
// Slots followed by strides. No stride for first virtual argument.
22402240
// For 1-method: the offset of the method in the method table, which
22412241
// contains a pointer to a function.
@@ -2384,11 +2384,6 @@ void method<Id, ReturnType(Parameters...), Registry>::resolve_type_ids() {
23842384
VirtualParameters>>::fn(this->vp_type_ids);
23852385
}
23862386

2387-
template<
2388-
typename Id, typename... Parameters, typename ReturnType, class Registry>
2389-
std::size_t method<
2390-
Id, ReturnType(Parameters...), Registry>::slots_strides[2 * Arity - 1];
2391-
23922387
template<
23932388
typename Id, typename... Parameters, typename ReturnType, class Registry>
23942389
method<Id, ReturnType(Parameters...), Registry>::~method() {

0 commit comments

Comments
 (0)