diff --git a/include/wrenpp/class_manager.hpp b/include/wrenpp/class_manager.hpp index d3345fb..457108b 100644 --- a/include/wrenpp/class_manager.hpp +++ b/include/wrenpp/class_manager.hpp @@ -79,7 +79,7 @@ namespace wren { ClassManager(); ~ClassManager() noexcept; - void add_class_maker (std::string_view module_name, std::string_view class_name, make_foreign_class_t); + ClassManager& add_class_maker (std::string_view module_name, std::string_view class_name, make_foreign_class_t); foreign_class_t make_class(std::string_view module_name, std::string_view class_name); private: diff --git a/src/class_manager.cpp b/src/class_manager.cpp index f0499c3..859f6ef 100644 --- a/src/class_manager.cpp +++ b/src/class_manager.cpp @@ -74,7 +74,7 @@ namespace wren { ClassManager::ClassManager() = default; ClassManager::~ClassManager() noexcept = default; - void ClassManager::add_class_maker (std::string_view module_name, std::string_view class_name, make_foreign_class_t maker) { + ClassManager& ClassManager::add_class_maker (std::string_view module_name, std::string_view class_name, make_foreign_class_t maker) { using detail::TempClassName; using detail::ClassNameOwning; @@ -83,6 +83,8 @@ namespace wren { m_classes.insert(it_found, std::make_pair(ClassNameOwning{module_name, class_name}, maker)); else it_found->second = maker; + + return *this; } foreign_class_t ClassManager::make_class (std::string_view module_name, std::string_view class_name) {