Determine if a type is dereferenceable

Synopsis

Declared in <mrdocs/Support/Concepts.hpp>

template<class T>
concept dereferenceable = requires(T const& t)
{
    { static_cast<bool>(t) };
    { *t };
};

Description

This concept checks if a type can be dereferenced to a value it represents and converted to a boolean value that represents if the object is in a valid state.

Examples of such types are std::optional, std::unique_ptr, std::shared_ptr, Polymorphic, pointers, etc.

Created with MrDocs