diff --git a/include/REL/Relocation.h b/include/REL/Relocation.h index 9e710f51..75353221 100644 --- a/include/REL/Relocation.h +++ b/include/REL/Relocation.h @@ -222,16 +222,6 @@ namespace REL return *this; } - [[nodiscard]] constexpr value_type get() const // - noexcept(std::is_nothrow_copy_constructible_v) - { - return stl::unrestricted_cast(_address); - } - - [[nodiscard]] constexpr decltype(auto) address() const noexcept { return _address; } - - [[nodiscard]] constexpr std::size_t offset() const noexcept { return _address - base(); } - [[nodiscard]] constexpr decltype(auto) operator*() const noexcept requires(std::is_pointer_v) { @@ -245,13 +235,21 @@ namespace REL } template - constexpr std::invoke_result_t operator()(Args&&... a_args) const // + constexpr std::invoke_result_t operator()(Args&&... a_args) const noexcept(std::is_nothrow_invocable_v) requires(std::invocable) { return invoke(get(), std::forward(a_args)...); } + [[nodiscard]] constexpr decltype(auto) address() const noexcept { return _address; } + [[nodiscard]] constexpr std::size_t offset() const noexcept { return _address - base(); } + + [[nodiscard]] constexpr value_type get() const + noexcept(std::is_nothrow_copy_constructible_v) + { + return stl::unrestricted_cast(_address); + } void write(const void* a_src, std::size_t a_count) requires(std::same_as) @@ -330,7 +328,10 @@ namespace REL } private: - [[nodiscard]] static constexpr std::uintptr_t base() { return Module::get().base(); } + [[nodiscard]] static constexpr std::uintptr_t base() + { + return Module::get().base(); + } std::uintptr_t _address{}; };