Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions modules/stormkit/core/functional/monadic.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export namespace stormkit { inline namespace core { namespace monadic {
[[nodiscard]]
constexpr auto is() noexcept -> decltype(auto);

template<typename T>
[[nodiscard]]
constexpr auto is(const T& value) noexcept -> decltype(auto);

[[nodiscard]]
constexpr auto clone() noexcept -> decltype(auto);

Expand Down Expand Up @@ -177,15 +181,6 @@ namespace stormkit { inline namespace core { namespace monadic {
};
}

////////////////////////////////////////
////////////////////////////////////////
template<typename T>
STORMKIT_FORCE_INLINE

constexpr auto is(T&& value) noexcept -> decltype(auto) {
return [value = std::forward<T>(value)]<typename U>(U&& other) { return core::is(value, std::forward<U>(other)); };
}

////////////////////////////////////////
////////////////////////////////////////
STORMKIT_FORCE_INLINE
Expand Down Expand Up @@ -327,11 +322,18 @@ namespace stormkit { inline namespace core { namespace monadic {
/////////////////////////////////////
template<typename T>
STORMKIT_FORCE_INLINE

constexpr auto is() noexcept -> decltype(auto) {
return []<typename U>(U&& value) static noexcept { return core::is<T>(std::forward<U>(value)); };
}

////////////////////////////////////////
////////////////////////////////////////
template<typename T>
STORMKIT_FORCE_INLINE
constexpr auto is(const T& value) noexcept -> decltype(auto) {
return [&value]<typename U>(U&& other) { return core::is(value, std::forward<U>(other)); };
}

/////////////////////////////////////
/////////////////////////////////////
template<std::regular_invocable<anything>... Ts>
Expand Down
Loading