Skip to content

T.46 contradicts the idea of type traits and is not resource-friendly #2281

@kitsnet

Description

@kitsnet

T.46, which requires types used as template arguments to be at least semiregular, seems to make type traits use (or any kind of generic compile-time reasoning based on types) disallowed for non-default-constructible and/or non-copyable types.

Another problem with T.46 is that it disallows using generic implementations with resource-conscious or lifetime-conscious types. Even the example of std::vector<T>, provided as a motivation for the rule, can show the deficiency of this rule when T is (non-copyable) std::unique_ptr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions