Skip to content

strong::underlying_type_t  #49

@davidhunter22

Description

@davidhunter22

I have a question about the following

    using Foo = strong::type<int const, struct FooTag>;
    using T = strong::underlying_type_t<Foo>;
    static_assert( std::is_same_v<Z, int const> );

The static_asset fails as the type T is an int not a int const.
I am wondering if this is deliberate? I certainly found it surprising.
This happens because the underlying_type_t is implemented by returning a instance of the underlying type and

    int const foo( ); // decltype( foo( ) ) is an int not an int const 

I am wondering why you don't use member types in strong::type I.E.

template<typename T, typename Tag, typename ... M>
class type : public modifier<M, type<T, Tag, M...>> ... {
    using element_type = T;
    using value_type = std::remove_cv_t<T>
    ...

like std::span does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions