Skip to content

<hash_map>: Consistently use int = 0 SFINAE #249

Description

Over the years, we settled on a consistent pattern for SFINAE: default template arguments of the form enable_if_t<CONDITION, int> = 0. This works in a wide variety of situations, including when we have an overload set where SFINAE makes exactly one overload viable. There are a few remaining occurrences of SFINAE that don't follow this pattern.

In <hash_map>, these occurrences are:

template <class _Valty, class = enable_if_t<is_constructible_v<value_type, _Valty>>>

template <class _Valty, class = enable_if_t<is_constructible_v<value_type, _Valty>>>

template <class _Valty, class = enable_if_t<is_constructible_v<value_type, _Valty>>>

template <class _Valty, class = enable_if_t<is_constructible_v<value_type, _Valty>>>

This change is currently blocked by a compiler bug. We need to provide a reduced test case to the compiler front-end team.

(Split from #187.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions