Iros
 
Loading...
Searching...
No Matches
any_storage.h
Go to the documentation of this file.
1#pragma once
2
4#include "di/meta/constexpr.h"
5#include "di/meta/core.h"
7#include "di/types/prelude.h"
8
9namespace di::concepts {
10template<typename T>
11concept AnyStorage = DefaultConstructible<T> && requires {
12 typename T::Interface;
13
14 // Must be a constant expression.
15 { T::storage_category() } -> SameAs<any::StorageCategory>;
16 typename meta::Constexpr<T::storage_category()>;
17
18 // This must be evaluatable for all types, not just Void.
19 { T::creation_is_fallible(in_place_type<Void>) } -> SameAs<bool>;
20
21 // Must be a constant expression.
22 typename meta::Constexpr<T::creation_is_fallible(in_place_type<Void>)>;
23
24 // This must be evaluatable for all types, not just Void. The return type is the result of creating the storage for
25 // a given type.
26 typename T::template CreationResult<Void>;
27};
28}
Definition any_storage.h:11
Definition operations.h:24
Definition core.h:114
Definition any_storable.h:9
constexpr auto in_place_type
Definition in_place_type.h:12
A wrapper for a constexpr value.
Definition core.h:77