13namespace di::any::detail {
14template<
typename Method,
typename Storage,
typename T>
17template<
typename Tag,
typename Storage,
typename R, concepts::RemoveCVRefSameAs<This> Self,
typename... BArgs,
19struct ErasedCallImpl<Method<
Tag, R(Self, BArgs...)>,
Storage, T> {
20 constexpr static auto call(
void* storage, BArgs... bargs) -> R {
21 using M = Method<
Tag, R(Self, BArgs...)>;
23 static_assert(concepts::AnyStorable<T, Storage>,
24 "Cannot create a vtable function for T not storable in Storage.");
25 static_assert(concepts::MethodCallableWith<M, meta::Like<Self, T>>,
26 "Cannot create a vtable function because the Method is not callable for T.");
28 auto const tag =
Tag {};
31 auto* typed_storage =
static_cast<QualifiedStorage*
>(storage);
32 auto*
object = typed_storage->template down_cast<meta::RemoveReference<T>>();
34 if constexpr (concepts::TagInvocableTo<Tag const&, R, M, meta::Like<Self, T>, BArgs...>) {
35 if constexpr (concepts::LanguageVoid<R>) {
meta::Type< StorageT< Send, Alloc > > Storage
Definition start_detached.h:87
constexpr auto invoke_r
Definition invoke.h:103
di::meta::Decay< decltype(T)> Tag
Definition tag_invoke.h:28
constexpr auto forward_like(U &&value) -> decltype(auto)
Definition forward_like.h:8
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22