Closed pemessier closed 3 years ago
I use the following skill to add the dereference operator (like in std::optional for example):
template< typename T > struct Dereferencable;` template< typename T, typename Parameter, template< typename > class ... Skills > struct Dereferencable< fluent::NamedType< T, Parameter, Skills... > > : fluent::crtp< fluent::NamedType< T, Parameter, Skills... >, Dereferencable > { constexpr const T& operator*() const & { return this->underlying().get(); } constexpr T& operator*() & { return this->underlying().get(); } };
Example usage:
void Fct( double value ); ... Fct( *strongType );
Note that I also added [[nodiscard]], but this could be a separate ticket
Merged in #53
I use the following skill to add the dereference operator (like in std::optional for example):
Example usage:
Note that I also added [[nodiscard]], but this could be a separate ticket