YOrch 1.0.0
Loading...
Searching...
No Matches
resolve.hpp File Reference
#include <functional>
#include <type_traits>
#include <utility>
#include "context.hpp"
#include "specs.hpp"
Include dependency graph for resolve.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  yorch
 
namespace  yorch::detail
 

Concepts

concept  yorch::bindable_from_lvalue
 
concept  yorch::resolvable_mutable_value
 
concept  yorch::resolvable_const_value
 

Typedefs

template<typename T >
using yorch::detail::from_ctx_source_t = typename from_ctx_t< T >::type
 
template<typename T >
using yorch::detail::borrow_prev_source_t = typename borrow_prev_t< T >::type
 
template<typename T >
using yorch::detail::borrow_prev_mut_source_t = typename borrow_prev_mut_t< T >::type
 
template<typename T >
using yorch::detail::copy_prev_source_t = typename copy_prev_t< T >::type
 
template<typename T >
using yorch::detail::consume_prev_source_t = typename consume_prev_t< T >::type
 

Functions

template<typename Arg , typename Source >
requires bindable_from_lvalue<Arg, Source>
constexpr decltype(auto) yorch::bind_from_lvalue (Source &src) noexcept(detail::bind_from_lvalue_nothrow_v< Arg, Source >)
 Binds an existing lvalue source object to the requested argument type.
 
template<typename Arg , typename T , typename Ctx , typename Prev >
constexpr decltype(auto) yorch::resolve_as (from_ctx_t< T >, exec_context< Ctx, Prev > &ec) noexcept(detail::resolve_from_ctx_nothrow_v< Arg, T, Ctx >)
 Resolves a from_ctx(...) spec by fetching the requested object from the execution context and binding it as Arg.
 
template<typename Arg , typename T , typename Ctx , typename Prev >
constexpr decltype(auto) yorch::resolve_as (borrow_prev_t< T >, exec_context< Ctx, Prev > &ec) noexcept(detail::resolve_borrow_prev_nothrow_v< Arg, T, Prev >)
 Resolves a borrow_prev(...) spec by fetching the direct parent output payload as a readonly borrow.
 
template<typename Arg , typename T , typename Ctx , typename Prev >
constexpr decltype(auto) yorch::resolve_as (borrow_prev_mut_t< T >, exec_context< Ctx, Prev > &ec) noexcept(detail::resolve_borrow_prev_mut_nothrow_v< Arg, T, Prev >)
 Resolves a borrow_prev_mut(...) spec by fetching the direct parent output payload as an exclusive mutable borrow.
 
template<typename Arg , typename T , typename Ctx , typename Prev >
constexpr decltype(auto) yorch::resolve_as (copy_prev_t< T >, exec_context< Ctx, Prev > &ec) noexcept(detail::resolve_copy_prev_nothrow_v< T, Prev >)
 Resolves a copy_prev(...) spec by copying the direct parent output payload into a new value.
 
template<typename Arg , typename T , typename Ctx , typename Prev >
constexpr decltype(auto) yorch::resolve_as (consume_prev_t< T >, exec_context< Ctx, Prev > &ec) noexcept(detail::resolve_consume_prev_nothrow_v< Arg, T, Prev >)
 Resolves a consume_prev(...) spec by moving from the direct parent output payload exactly once.
 
template<typename Arg , typename T , typename Ctx , typename Prev >
constexpr decltype(auto) yorch::resolve_as (value_t< std::reference_wrapper< T > > &spec, exec_context< Ctx, Prev > &) noexcept(std::is_reference_v< Arg >)
 Resolves a mutable value(...) spec into the requested argument type.
 
template<typename Arg , typename T , typename Ctx , typename Prev >
constexpr decltype(auto) yorch::resolve_as (const value_t< std::reference_wrapper< T > > &spec, exec_context< Ctx, Prev > &) noexcept(std::is_reference_v< Arg >)
 
template<typename Arg , typename T , typename Ctx , typename Prev >
requires resolvable_mutable_value<Arg, T>
constexpr decltype(auto) yorch::resolve_as (value_t< T > &spec, exec_context< Ctx, Prev > &) noexcept(detail::resolve_value_nothrow_v< Arg, T >)
 
template<typename Arg , typename T , typename Ctx , typename Prev >
requires resolvable_const_value<Arg, T>
constexpr decltype(auto) yorch::resolve_as (const value_t< T > &spec, exec_context< Ctx, Prev > &) noexcept(detail::resolve_const_value_nothrow_v< Arg, T >)
 Resolves a const value(...) spec into the requested argument type.
 
template<typename Arg , typename Spec , typename Ctx , typename Prev >
constexpr decltype(auto) yorch::resolve_as (Spec &&, exec_context< Ctx, Prev > &)
 Fallback overload for unsupported spec categories.
 

Variables

template<typename >
constexpr bool yorch::detail::always_false_v = false
 
template<typename Arg , typename Source >
constexpr bool yorch::detail::supports_bind_from_lvalue_v
 
template<typename Arg , typename Source >
constexpr bool yorch::detail::bind_from_lvalue_nothrow_v
 
template<typename Ctx , typename T >
constexpr bool yorch::detail::ctx_get_nothrow_v
 
template<typename Prev , typename Source >
constexpr bool yorch::detail::prev_get_source_nothrow_v
 
template<typename Arg , typename T , typename Ctx >
constexpr bool yorch::detail::resolve_from_ctx_nothrow_v
 
template<typename Arg , typename T , typename Prev >
constexpr bool yorch::detail::resolve_borrow_prev_nothrow_v
 
template<typename Arg , typename T , typename Prev >
constexpr bool yorch::detail::resolve_borrow_prev_mut_nothrow_v
 
template<typename T , typename Prev >
constexpr bool yorch::detail::resolve_copy_prev_nothrow_v
 
template<typename Arg , typename T >
constexpr bool yorch::detail::consume_bind_nothrow_v
 
template<typename Arg , typename T , typename Prev >
constexpr bool yorch::detail::resolve_consume_prev_nothrow_v
 
template<typename Arg , typename T >
constexpr bool yorch::detail::resolve_value_nothrow_v
 
template<typename Arg , typename T >
constexpr bool yorch::detail::resolve_const_value_nothrow_v