Skip to content

STL: Consistently use int = 0 SFINAE #187

@StephanTLavavej

Description

@StephanTLavavej

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. (Historically, it also avoided compiler bugs, but this is much less of a concern now.)

There are a few remaining occurrences of SFINAE that don't follow this pattern. We believe that all compiler bugs preventing us from using the modern pattern have been fixed, so we should finish updating these occurrences.

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