Skip to content

Add SFINAE overloading to Set and HashSet constructor #77

@htiek

Description

@htiek

At present, the Set and HashSet types layer on top of GenericSet and forward template arguments to GenericSet. In the case where those template arguments would result in an instantiation error, the constructors are still selected in overload resolution and lead to weird error messages during instantiation. A better solution would be to use std::enable_if etc. to disable those constructors unless arguments of the proper types are provided.

(This isn't purely hypothetical; when implementing Optional<T> for my CS106B offering, I ran into a weird overload selection issue that required some special-casing for the Set type.)

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