diff --git a/CMakeLists.txt b/CMakeLists.txt index e3f69860..44925fea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,11 @@ install(EXPORT YOMM2Targets NAMESPACE YOMM2:: DESTINATION lib/cmake/YOMM2 ) +# Configure package config (tells using code about dependencies) +configure_package_config_file( + cmake/YOMM2Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/YOMM2Config.cmake + INSTALL_DESTINATION lib/cmake/YOMM2 +) # Copy config files to install directory install(FILES "${CMAKE_CURRENT_BINARY_DIR}/YOMM2Config.cmake" diff --git a/cmake/YOMM2Config.cmake.in b/cmake/YOMM2Config.cmake.in new file mode 100644 index 00000000..f9380669 --- /dev/null +++ b/cmake/YOMM2Config.cmake.in @@ -0,0 +1,11 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) + +# Tell library users about the Boost dependency +find_dependency(Boost 1.74... REQUIRED) + +# Add the targets file +include("${CMAKE_CURRENT_LIST_DIR}/YOMM2Targets.cmake") + +check_required_components(YOMM2) diff --git a/include/yorel/yomm2/core.hpp b/include/yorel/yomm2/core.hpp index 8b89d33b..5a7b395f 100644 --- a/include/yorel/yomm2/core.hpp +++ b/include/yorel/yomm2/core.hpp @@ -84,9 +84,7 @@ struct method : detail::method_info { std::uintptr_t resolve_uni(const ArgType& arg, const MoreArgTypes&... more_args) const; - template< - std::size_t VirtualArg, typename MethodArgList, typename ArgType, - typename... MoreArgTypes> + template std::uintptr_t resolve_multi_first( const ArgType& arg, const MoreArgTypes&... more_args) const; @@ -457,7 +455,7 @@ method::resolve(const ArgType&... args) const { if constexpr (arity == 1) { pf = resolve_uni, ArgType...>(args...); } else { - pf = resolve_multi_first<0, types, ArgType...>(args...); + pf = resolve_multi_first, ArgType...>(args...); } return reinterpret_cast(pf); @@ -527,9 +525,7 @@ inline std::uintptr_t method::resolve_uni( } template -template< - std::size_t VirtualArg, typename MethodArgList, typename ArgType, - typename... MoreArgTypes> +template inline std::uintptr_t method::resolve_multi_first( const ArgType& arg, const MoreArgTypes&... more_args) const {