From 9c147b1a6e08e9fcd34606d29b2d9ada7c145799 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Tue, 17 May 2022 02:22:14 +0200 Subject: [PATCH] Build fix for function that is not being used by any examples yet Signature of `make_wren_object()` changed slightly --- include/wrenpp/detail/guess_class_name.hpp | 10 +++++----- include/wrenpp/vm_fun.hpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/wrenpp/detail/guess_class_name.hpp b/include/wrenpp/detail/guess_class_name.hpp index 087724f..ea47067 100644 --- a/include/wrenpp/detail/guess_class_name.hpp +++ b/include/wrenpp/detail/guess_class_name.hpp @@ -70,13 +70,13 @@ namespace wren { # error "Unsupported compiler" #endif } - - template ().size()> - static constinit dhandy::bt::string g_class_names = {guess_class_name_impl()}; } //namespace detail + template ().size()> + constexpr dhandy::bt::string g_guessed_class_name = {detail::guess_class_name_impl()}; + template - const char* guess_class_name() { - return detail::g_class_names.data(); + constexpr const char* guess_class_name() { + return g_guessed_class_name.data(); } } //namespace wren diff --git a/include/wrenpp/vm_fun.hpp b/include/wrenpp/vm_fun.hpp index 4fe9aab..09e77f1 100644 --- a/include/wrenpp/vm_fun.hpp +++ b/include/wrenpp/vm_fun.hpp @@ -48,8 +48,8 @@ namespace wren { T* make_wren_object(VM& vm, ModuleAndName mn, Args&&... args); #if defined(WRENPP_WITH_NAME_GUESSING) - template - T* make_wren_object(VM& vm, const char* module, Args&&... args); + template + T* make_wren_object(VM& vm, Args&&... args); #endif template @@ -179,11 +179,11 @@ namespace wren { } #if defined(WRENPP_WITH_NAME_GUESSING) - template - inline T* make_wren_object(VM& vm, const char* module, Args&&... args) { + template + inline T* make_wren_object(VM& vm, Args&&... args) { return make_wren_object( vm, - ModuleAndName{module, guess_class_name()}, + MN>, std::forward(args)... ); }