diff --git a/.gitignore b/.gitignore index 9e0b883..c5e7263 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ build/ ## VSCode.gitignore -.vscode/ \ No newline at end of file +.vscode/ + +.cache/ diff --git a/CMakeLists.txt b/CMakeLists.txt index af79d66..b73a683 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR) cmake_policy(SET CMP0097 NEW) -project(GeodeResult VERSION 1.0.0 LANGUAGES C CXX) +project(GeodeResult VERSION 1.1.1 LANGUAGES C CXX) add_library(GeodeResult INTERFACE) @@ -14,4 +14,4 @@ target_include_directories(GeodeResult INTERFACE if (PROJECT_IS_TOP_LEVEL) add_subdirectory(test) -endif() \ No newline at end of file +endif() diff --git a/include/Geode/Result.hpp b/include/Geode/Result.hpp index 29ed032..3245f42 100644 --- a/include/Geode/Result.hpp +++ b/include/Geode/Result.hpp @@ -1071,7 +1071,9 @@ namespace geode { /// @brief Inspects the Ok value with an operation /// @param operation the operation to call the Ok value with /// @return the Result itself - constexpr Result& inspect(std::invocable auto&& operation + template + requires(!std::same_as && std::invocable) + constexpr Result& inspect(Fn&& operation ) noexcept(noexcept(operation(std::declval()))) { this->inspectInternal(operation); return *this; @@ -1080,7 +1082,9 @@ namespace geode { /// @brief Inspects the Err value with an operation /// @param operation the operation to call the Err value with /// @return the Result itself - constexpr Result& inspectErr(std::invocable auto&& operation + template + requires(!std::same_as && std::invocable) + constexpr Result& inspectErr(Fn&& operation ) noexcept(noexcept(operation(std::declval()))) { this->inspectInternalErr(operation); return *this; @@ -1379,4 +1383,4 @@ namespace geode { } } -#endif // GEODE_RESULT_HPP \ No newline at end of file +#endif // GEODE_RESULT_HPP