di 0.1.0
Loading...
Searching...
No Matches
get_env.h
Go to the documentation of this file.
1#pragma once
2
7#include "di/meta/util.h"
8
9namespace di::execution {
10namespace detail {
11 struct GetEnvFunction {
12 template<typename T>
13 constexpr auto operator()(T const& value) const -> decltype(auto) {
14 if constexpr (concepts::TagInvocable<GetEnvFunction, T const&>) {
15 static_assert(concepts::Queryable<meta::TagInvokeResult<GetEnvFunction, T const&>>,
16 "get_env() must return a Queryable.");
17 return function::tag_invoke(*this, value);
18 } else {
19 return types::EmptyEnv {};
20 }
21 }
22
23 constexpr auto operator()() const;
24 };
25}
26
27constexpr inline auto get_env = detail::GetEnvFunction {};
28}
Definition bulk.h:30
constexpr auto get_env
Definition get_env.h:27
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22