Skip to content

Marius Bancila's Blog

About code. Mostly on C++

  • Home
  • About me
  • Works
  • Privacy Policy

SFINAE

Concepts versus SFINAE-based constraints

October 4, 2019 by Marius Bancila

In some situations, we need to makes sure function templates can only be invoked with some specific types. SFINAE (that stands for Substitution Failure Is Not An Error) is a set of rules that specify how compilers can discard specializations from the overload resolution without causing errors. A way to achieve this is with the help of std::enable_if.

Categories C++ Tags C++, c++20, concepts, SFINAE 2 Comments

About me

Find me on:

Archives

November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Follow me on Twitter

My Tweets

Recent Posts

  • The C++26 inplace_vector container
  • Composite objects and C++26 the std::polymorphic type
  • cppdashboard.dev – The aggregator of what matters in C++ right now
  • The PImpl idiom and the C++26 std::indirect type
  • Improvements to std::format in C++26
  • Multiplying matrices in C++
  • Universally Unique Lexicographically Sortable Identifiers (ULIDs)
  • Time-based Universally Unique Identifiers (UUIDs v7)
  • What is the C++ nth_element algorithm?
  • What’s new in C++26: contracts (part 3)

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2026 Marius Bancila's Blog • Built with GeneratePress