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)... ); }