3 Commits

Author SHA1 Message Date
Jean-Louis Leroy
f53122eae8 cmake: fix dlopen example 2025-12-22 23:16:02 -05:00
copilot-swe-agent[bot]
41eaec5bef Fix duplicate "because" typo in basics.adoc
Co-authored-by: jll63 <5083077+jll63@users.noreply.github.com>
2025-12-19 00:31:36 -05:00
Jean-Louis Leroy
5796d3c3ea add semicolons after BOOST_OPENMETHOD_CLASSES in examples 2025-12-18 17:04:17 -05:00
12 changed files with 19 additions and 13 deletions

View File

@@ -14,5 +14,5 @@ BOOST_OPENMETHOD_OVERRIDE(
return 5000.0;
}
BOOST_OPENMETHOD_CLASSES(Employee)
BOOST_OPENMETHOD_CLASSES(Employee);
// end::content[]

View File

@@ -14,6 +14,6 @@ BOOST_OPENMETHOD_OVERRIDE(
return next(emp) + emp->sales * 0.05; // base + commission
}
BOOST_OPENMETHOD_CLASSES(Employee, Salesman)
BOOST_OPENMETHOD_CLASSES(Employee, Salesman);
// end::content[]

View File

@@ -12,5 +12,5 @@ BOOST_OPENMETHOD_DEFINE_OVERRIDER(
return 5000.0;
}
BOOST_OPENMETHOD_CLASSES(Employee)
BOOST_OPENMETHOD_CLASSES(Employee);
// end::content[]

View File

@@ -16,4 +16,4 @@ BOOST_OPENMETHOD_OVERRIDE(
}
// end::content[]
BOOST_OPENMETHOD_CLASSES(Employee, Salesman)
BOOST_OPENMETHOD_CLASSES(Employee, Salesman);

View File

@@ -7,5 +7,5 @@
#include "roles.hpp"
#include <boost/openmethod.hpp>
BOOST_OPENMETHOD_CLASSES(Employee)
BOOST_OPENMETHOD_CLASSES(Employee);
// end::content[]

View File

@@ -16,4 +16,4 @@ BOOST_OPENMETHOD_OVERRIDE(
}
// end::content[]
BOOST_OPENMETHOD_CLASSES(Employee, Salesman)
BOOST_OPENMETHOD_CLASSES(Employee, Salesman);

View File

@@ -7,5 +7,5 @@
#include "roles.hpp"
#include <boost/openmethod.hpp>
BOOST_OPENMETHOD_CLASSES(employees::Employee)
BOOST_OPENMETHOD_CLASSES(employees::Employee);
// end::content[]

View File

@@ -17,7 +17,7 @@ BOOST_OPENMETHOD_OVERRIDE(
emp->sales * 0.05; // base + commission
}
BOOST_OPENMETHOD_CLASSES(employees::Employee, Salesman)
BOOST_OPENMETHOD_CLASSES(employees::Employee, Salesman);
} // namespace sales
// end::content[]

View File

@@ -71,7 +71,7 @@ BOOST_OPENMETHOD_OVERRIDE(
}
// ...and let's not forget to register the classes
BOOST_OPENMETHOD_CLASSES(Employee, Salesman)
BOOST_OPENMETHOD_CLASSES(Employee, Salesman);
// end::overriders[]
// tag::main[]

View File

@@ -66,7 +66,7 @@ BOOST_OPENMETHOD_OVERRIDE(
}
// ...and let's not forget to register the classes
BOOST_OPENMETHOD_CLASSES(Employee, Salesman)
BOOST_OPENMETHOD_CLASSES(Employee, Salesman);
// end::overriders[]
// tag::main[]

View File

@@ -12,7 +12,10 @@ add_compile_definitions(BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS)
add_library(boost_openmethod-shared SHARED extensions.cpp)
target_link_libraries(boost_openmethod-shared Boost::openmethod)
set_target_properties(boost_openmethod-shared PROPERTIES ENABLE_EXPORTS ON)
set_target_properties(boost_openmethod-shared PROPERTIES
ENABLE_EXPORTS ON
OUTPUT_NAME shared
)
add_executable(boost_openmethod-static static_main.cpp)
target_link_libraries(boost_openmethod-static Boost::openmethod Boost::dll boost_openmethod-shared)
@@ -36,7 +39,10 @@ add_library(boost_openmethod-indirect_shared SHARED indirect_extensions.cpp)
target_compile_definitions(
boost_openmethod-indirect_shared PUBLIC BOOST_OPENMETHOD_DEFAULT_REGISTRY=indirect_registry)
target_link_libraries(boost_openmethod-indirect_shared PRIVATE Boost::openmethod Boost::dll)
set_target_properties(boost_openmethod-indirect_shared PROPERTIES ENABLE_EXPORTS ON)
set_target_properties(boost_openmethod-indirect_shared PROPERTIES
ENABLE_EXPORTS ON
OUTPUT_NAME indirect_shared
)
add_executable(boost_openmethod-indirect indirect_main.cpp)
target_compile_definitions(

View File

@@ -6,7 +6,7 @@ An _open-method_ is a free-standing function that has one or more _virtual_
_parameters_. When it is called, it forwards to an _overrider_ selected from a
set by examining the dynamic types of the virtual parameters.
If this sounds like a virtual function, that's because because an open-method
If this sounds like a virtual function, that's because an open-method
with one virtual parameter is equivalent to a virtual function - with one big
difference: it exists outside of classes.