Namespaces
Variants
Actions

Talk:cpp/language/sfinae

From cppreference.com

I recently gave a presentation on templates of which SFINAE was part of the discussion. Using the examples on this page to present the concept was quite confusing, particularly when the example code is read aloud. I tried to improve some of this by having the first code snippet use A and B for some identifiers so that we could talk about types without having the identifiers also containing the text "type" which makes for some confusing verbiage when read aloud.

SFINAE is a fairly deep topic however and I feel this page could use more examples and perhaps even some additional explanatory text in order to convey the concept more fully. I noticed that Wikipedia's page on SFINAE had some simpler examples than are present here and we should consider including them here.

A good example of the depth of SFINAE was presented at the CppCon 2017 talk "A Soupcon of SFINAE" -- Legalize (talk) 09:04, 20 November 2017 (PST)

[edit] Non-standard SFINAE in partial specialization declarations

Resolved

Though SFINAE in partial specializations hasn't been in the standard yet (CWG2054), it is accepted by gcc, clang and msvc and used in implementations of <type_traits> (libstdc++, libc++, and MSVC STL). Dection idiom in LFTS also requires its validity. Should we introduce SFINAE in partial specializations? --Fruderica (talk) 11:20, 4 June 2020 (PDT)

Resolved by myself. --Fruderica (talk) 09:42, 14 October 2020 (PDT)

close