idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::has_factory Concept Reference

Concept for types that provide a static make() factory method returning result<T>. More...

#include <idfxx_core/include/idfxx/error.hpp>

Concept definition

template<typename T, typename... Args>
concept idfxx::has_factory = requires {
{ T::make(std::declval<Args>()...) } -> std::same_as<result<T>>;
}
Concept for types that provide a static make() factory method returning result<T>.
Definition error.hpp:132
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Definition error.hpp:120

Detailed Description

Concept for types that provide a static make() factory method returning result<T>.

A type satisfies this concept if T::make(args...) is a valid expression returning result<T> for the given argument types.

Template Parameters
TThe type to check.
ArgsThe argument types to pass to T::make().

Definition at line 132 of file error.hpp.