|
| std::optional< const std::string_view > | Env (std::string_view envkey) |
| | Get variables from the ".env" file. Supports command execution and multiline.
|
| |
| std::optional< const std::u8string_view > | Utf8Env (std::string_view envkey) |
| | Get variables from the ".env" file. Supports command execution and multiline.
|
| |
| template<auto V> |
| constexpr auto | ToValue () |
| | If the template parameter is a value, then returns it. If is a type then construct and returns it.
|
| |
| template<class T > |
| constexpr T | ToValue () |
| | If the template parameter is a value, then returns it. If is a type then construct and returns it.
|
| |
| template<class Ret , class Class , class... Args> |
| constexpr auto | Const (Ret(Class::*ptr)(Args...) const) |
| |
| template<class Ret , class Class , class... Args> |
| constexpr auto | Mut (Ret(Class::*ptr)(Args...)) |
| |
| template<class Ret , class Class , class... Args> |
| constexpr auto | ConstFn (Ret(Class::*ptr)(Args...) const) |
| |
| template<class Ret , class Class , class... Args> |
| constexpr auto | MutFn (Ret(Class::*ptr)(Args...)) |
| |
| template<class Opt , class Err > |
| constexpr std::expected< typename std::remove_cvref_t< Opt >::value_type, Err > | ValueOr (Opt &&val, Err &&err) |
| | Monad friendly function to transform std::expected<std::optional<T>, Err> into std::expected<T, Err> with a given Err.
|
| |
| template<class Opt , class Err > |
| constexpr auto | ValueOrHof (Err &&err) |
| | @hof{ValueOr}
|
| |
template<bool Negate, class Pred , class Trans , class Val >
requires std::predicate<Pred&, Val&> && std::invocable<Trans, Val> |
| constexpr std::expected< Val, std::invoke_result_t< Trans, Val > > | S_CallIfErrorImpl (Pred &&pred, Trans &&trans, Val &&value) |
| |
| template<class Pred , class Trans , class Val > |
| constexpr auto | CallIfError (Pred &&pred, Trans &&trans, Val &&value) |
| | In the std::expected<Val, Err> context, returns the value if the predicate match, or the std::unexpected with transformation applied to the error otherwise.
|
| |
| template<auto Pred, class Trans , class Val > |
| constexpr auto | CallIfError (Trans &&trans, Val &&val) |
| | In the std::expected<Val, Err> context, returns the value if the predicate match, or the std::unexpected with transformation applied to the error otherwise.
|
| |
| template<auto Pred, auto Trans, class Val > |
| constexpr auto | CallIfError (Val &&val) |
| | In the std::expected<Val, Err> context, returns the value if the predicate match, or the std::unexpected with transformation applied to the error otherwise.
|
| |
| template<class Pred , class Trans , class Val > |
| constexpr auto | CallIfErrorNot (Pred &&pred, Trans &&trans, Val &&value) |
| | In the std::expected<Val, Err> context, returns the value if the predicate doesn't match, or the std::unexpected with transformation applied to the error otherwise.
|
| |
| template<auto Pred, class Trans , class Val > |
| constexpr auto | CallIfErrorNot (Trans &&trans, Val &&val) |
| | In the std::expected<Val, Err> context, returns the value if the predicate doesn't match, or the std::unexpected with transformation applied to the error otherwise.
|
| |
| template<auto Pred, auto Trans, class Val > |
| constexpr auto | CallIfErrorNot (Val &&val) |
| | In the std::expected<Val, Err> context, returns the value if the predicate doesn't match, or the std::unexpected with transformation applied to the error otherwise.
|
| |
| template<class Pred , class Trans > |
| constexpr auto | CallIfErrorHof (Pred &&pred, Trans &&trans) |
| | @hof{CallIfError}
|
| |
| template<auto Pred, class Trans > |
| constexpr auto | CallIfErrorHof (Trans &&trans) |
| | @hof{CallIfError}
|
| |
| template<auto Pred, auto Trans> |
| constexpr auto | CallIfErrorHof () |
| | @hof{CallIfError}
|
| |
| template<class Pred , class Trans > |
| constexpr auto | CallIfErrorNotHof (Pred &&pred, Trans &&trans) |
| | @hof{CallIfErrorNot}
|
| |
| template<auto Pred, class Trans > |
| constexpr auto | CallIfErrorNotHof (Trans &&trans) |
| | @hof{CallIfErrorNot}
|
| |
| template<auto Pred, auto Trans> |
| constexpr auto | CallIfErrorNotHof () |
| | @hof{CallIfErrorNot}
|
| |
template<bool Negate, class Pred , class Val >
requires std::predicate<Pred&, Val&> |
| constexpr bool | S_TestIfImpl (Pred &&pred, Val &value) |
| |
template<bool Negate, class Pred , class Val , class Err >
requires std::predicate<Pred&, Val&> |
| constexpr std::expected< Val, std::decay_t< Err > > | S_ErrorIfImpl (Pred &&pred, Val &&value, Err &&error) |
| |
| template<class Pred , class Val , class Err > |
| constexpr auto | ErrorIf (Pred &&pred, Val &&value, Err &&error) |
| | In a std::expected<Val, Err> context, transform an error into a value only if the predicate match.
|
| |
| template<auto Pred, class Val , class Err > |
| constexpr auto | ErrorIf (Val &&value, Err &&error) |
| | In a std::expected<Val, Err> context, transform an error into a value only if the predicate match.
|
| |
| template<class Pred , class Val , class Err > |
| constexpr auto | ErrorIfNot (Pred &&pred, Val &&value, Err &&error) |
| | In a std::expected<Val, Err> context, transform an error into a value only if the predicate doesn't match.
|
| |
| template<auto Pred, class Val , class Err > |
| constexpr auto | ErrorIfNot (Val &&value, Err &&error) |
| | In a std::expected<Val, Err> context, transform an error into a value only if the predicate doesn't match.
|
| |
| template<class Pred , class Err > |
| constexpr auto | ErrorIfHof (Pred &&pred, Err &&error) |
| | @hof{ErrorIf}
|
| |
| template<auto Pred, class Err > |
| constexpr auto | ErrorIfHof (Err &&error) |
| | @hof{ErrorIf}
|
| |
| template<class Pred , class Err > |
| constexpr auto | ErrorIfNotHof (Pred &&pred, Err &&error) |
| | @hof{ErrorIfNof}
|
| |
| template<auto Pred, class Err > |
| constexpr auto | ErrorIfNotHof (Err &&error) |
| | @hof{ErrorIfNot}
|
| |
template<bool Negate, class Pred , class Trans , class Val >
requires std::predicate<Pred&, Val&> && std::invocable<Trans, Val> |
| constexpr auto | S_TransformOptIfImpl (Pred &&pred, Trans &&trans, Val &&value) -> std::optional< std::invoke_result_t< Trans, Val > > |
| |
template<bool Negate, class Pred , class Trans , class Val , class Err >
requires std::predicate<Pred&, Val&> && std::invocable<Trans, Val> |
| constexpr auto | S_TransformExpIfImpl (Pred &&pred, Trans &&trans, Val &&value, Err &&error) -> std::expected< std::invoke_result_t< Trans, Val >, std::decay_t< Err > > |
| |
template<class Pred , class Trans , class Val >
requires std::predicate<Pred&, Val&> && std::invocable<Trans, Val> |
| constexpr auto | TransformOptIf (Pred &&pred, Trans &&trans, Val &&value) |
| | In the std::optional<Val> context, returns the transformation applied to the value if the predicate match, or std::nullopt otherwise.
|
| |
template<auto Pred, class Trans , class Val >
requires std::predicate<decltype(Pred), Val&> && std::invocable<Trans, Val> |
| constexpr auto | TransformOptIf (Trans &&trans, Val &&value) |
| | In the std::optional<Val> context, returns the transformation applied to the value if the predicate match, or std::nullopt otherwise.
|
| |
template<auto Pred, auto Trans, class Val >
requires std::invocable<decltype(Trans), Val> |
| constexpr auto | TransformOptIf (Val &&value) |
| | In the std::optional<Val> context, returns the transformation applied to the value if the predicate match, or std::nullopt otherwise.
|
| |
template<class Pred , class Trans , class Val >
requires std::predicate<Pred&, Val&> && std::invocable<Trans, Val> |
| constexpr auto | TransformOptIfNot (Pred &&pred, Trans &&trans, Val &&value) |
| | In the std::optional<Val> context, returns the transformation applied to the value if the predicate doesn't match, or std::nullopt otherwise.
|
| |
template<auto Pred, class Trans , class Val >
requires std::predicate<decltype(Pred), Val&> && std::invocable<Trans, Val> |
| constexpr auto | TransformOptIfNot (Trans &&trans, Val &&value) |
| | In the std::optional<Val> context, returns the transformation applied to the value if the predicate doesn't match, or std::nullopt otherwise.
|
| |
template<auto Pred, auto Trans, class Val >
requires std::invocable<decltype(Trans), Val> |
| constexpr auto | TransformOptIfNot (Val &&value) |
| | In the std::optional<Val> context, returns the transformation applied to the value if the predicate doesn't match, or std::nullopt otherwise.
|
| |
| template<class Pred , class Trans > |
| constexpr auto | TransformOptIfHof (Pred &&pred, Trans &&trans) |
| | @hof{TransformOptIf}
|
| |
| template<auto Pred, class Trans > |
| constexpr auto | TransformOptIfHof (Trans &&trans) |
| | @hof{TransformOptIf}
|
| |
| template<auto Pred, auto Trans> |
| constexpr auto | TransformOptIfHof () |
| | @hof{TransformOptIf}
|
| |
| template<class Pred , class Trans > |
| constexpr auto | TransformOptIfNotHof (Pred &&pred, Trans &&trans) |
| | @hof{TransformOptIfNot}
|
| |
| template<auto Pred, class Trans > |
| constexpr auto | TransformOptIfNotHof (Trans &&trans) |
| | @hof{TransformOptIfNot}
|
| |
| template<auto Pred, auto Trans> |
| constexpr auto | TransformOptIfNotHof () |
| | @hof{TransformOptIfNot}
|
| |
template<class Pred , class Trans , class Val , class Err >
requires std::predicate<Pred&, Val&> && std::invocable<Trans, Val> |
| constexpr auto | TransformExpIf (Pred &&pred, Trans &&trans, Val &&value, Err &&error) |
| | In the std::expected<Val, Err> context, returns the transformation applied to the value if the predicate match, or std::unexpected{ error } otherwise.
|
| |
template<auto Pred, class Trans , class Val , class Err >
requires std::predicate<decltype(Pred), Val&> && std::invocable<Trans, Val> |
| constexpr auto | TransformExpIf (Trans &&trans, Val &&value, Err &&error) |
| | In the std::expected<Val, Err> context, returns the transformation applied to the value if the predicate match, or std::unexpected{ error } otherwise.
|
| |
template<auto Pred, auto Trans, class Val , class Err >
requires std::invocable<decltype(Trans), Val> |
| constexpr auto | TransformExpIf (Val &&value, Err &&error) |
| | In the std::expected<Val, Err> context, returns the transformation applied to the value if the predicate match, or std::unexpected{ error } otherwise.
|
| |
template<class Pred , class Trans , class Val , class Err >
requires std::predicate<Pred&, Val&> && std::invocable<Trans, Val> |
| constexpr auto | TransformExpIfNot (Pred &&pred, Trans &&trans, Val &&value, Err &&error) |
| | In the std::expected<Val, Err> context, returns the transformation applied to the value if the predicate doesn't match, or std::unexpected{ error } otherwise.
|
| |
template<auto Pred, class Trans , class Val , class Err >
requires std::predicate<decltype(Pred), Val&> && std::invocable<Trans, Val> |
| constexpr auto | TransformExpIfNot (Trans &&trans, Val &&value, Err &&error) |
| | In the std::expected<Val, Err> context, returns the transformation applied to the value if the predicate doesn't match, or std::unexpected{ error } otherwise.
|
| |
template<auto Pred, auto Trans, class Val , class Err >
requires std::invocable<decltype(Trans), Val> |
| constexpr auto | TransformExpIfNot (Val &&value, Err &&error) |
| | In the std::expected<Val, Err> context, returns the transformation applied to the value if the predicate doesn't match, or std::unexpected{ error } otherwise.
|
| |
| template<class Pred , class Trans , class Err > |
| constexpr auto | TransformExpIfHof (Pred &&pred, Trans &&trans, Err &&error) |
| | @hof{TransformExpIf}
|
| |
| template<auto Pred, class Trans , class Err > |
| constexpr auto | TransformExpIfHof (Trans &&trans, Err &&error) |
| | @hof{TransformExpIf}
|
| |
| template<auto Pred, auto Trans, class Err > |
| constexpr auto | TransformExpIfHof (Err &&error) |
| | @hof{TransformExpIf}
|
| |
| template<class Pred , class Trans , class Err > |
| constexpr auto | TransformExpIfNotHof (Pred &&pred, Trans &&trans, Err &&error) |
| | @hof{TransformExpIfNot}
|
| |
| template<auto Pred, class Trans , class Err > |
| constexpr auto | TransformExpIfNotHof (Trans &&trans, Err &&error) |
| | @hof{TransformExpIfNot}
|
| |
| template<auto Pred, auto Trans, class Err > |
| constexpr auto | TransformExpIfNotHof (Err &&error) |
| | @hof{TransformExpIfNot}
|
| |
template<bool Negate, class Pred , class Val >
requires std::predicate<Pred&, Val&> |
| constexpr std::optional< std::remove_cvref_t< Val > > | S_NulloptIfImpl (Pred &&pred, Val &&value) |
| |
| template<class Pred , class Val > |
| constexpr auto | NulloptIf (Pred &&pred, Val &&value) |
| | In a std::optional<T> context, transforms the value to std::nullopt if the predicate match.
|
| |
| template<auto Pred, class Val > |
| constexpr auto | NulloptIf (Val &&value) |
| | In a std::optional<T> context, transforms the value to std::nullopt if the predicate match.
|
| |
| template<class Pred , class Val > |
| constexpr auto | NulloptIfNot (Pred &&pred, Val &&value) |
| | In a std::optional<T> context, transforms the value to std::nullopt if the predicate doesn't match.
|
| |
| template<auto Pred, class Val > |
| constexpr auto | NulloptIfNot (Val &&value) |
| | In a std::optional<T> context, transforms the value to std::nullopt if the predicate doesn't match.
|
| |
| template<class Pred > |
| constexpr auto | NulloptIfHof (Pred &&pred) |
| | @hof{NulloptIf}
|
| |
| template<auto Pred> |
| constexpr auto | NulloptIfHof () |
| | @hof{NulloptIf}
|
| |
| template<class Pred > |
| constexpr auto | NulloptIfNotHof (Pred &&pred) |
| | @hof{NulloptIfNot}
|
| |
| template<auto Pred> |
| constexpr auto | NulloptIfNotHof () |
| | @hof{NulloptIfNot}
|
| |
template<std::ranges::input_range R, class F , class Acc , class Exp = std::iter_value_t<R>, class Val = Exp::value_type, class Err = Exp::error_type>
requires std::same_as<Exp, std::expected<Val, Err>> && std::invocable<F, Acc, Val> && std::same_as<Acc, std::invoke_result_t<F, Acc, Val>> |
| constexpr std::expected< std::remove_cvref_t< Acc >, std::remove_cvref_t< Err > > | FoldWhileSuccess (R &&range, F &&callable, Acc &&initial={}) |
| | fast fail foldr
|
| |
| template<class F , class Exp > |
| constexpr auto | FoldWhileSuccessHof (F &&callable, Exp &&reducer={}) |
| | @hof{FoldWhileSuccess}
|
| |
template<class T , class F >
requires std::invocable<F, T> |
| constexpr auto | Self (T &&val, F &&callable) |
| |
| template<class F > |
| constexpr auto | SelfHof (F &&callable) |
| |
| constexpr void | HashCombine (size_t &seed, const size_t v) |
| |
| template<class T , class Variant , template< class, class > class Relation, std::size_t Index = 0> |
| consteval size_t | FindMatchIndexImpl () |
| |
| template<class T , class Variant , template< class, class > class Relation> |
| consteval std::size_t | FindMatchIndex () |
| |