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.)
At present, the
SetandHashSettypes layer on top ofGenericSetand forward template arguments toGenericSet. 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 usestd::enable_ifetc. 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 theSettype.)