Skip to content

Marius Bancila's Blog

About code. Mostly on C++

  • Home
  • About me
  • Works
  • Privacy Policy

Day: October 4, 2019

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

October 2019
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Sep   Nov »

Follow me on Twitter

My Tweets

Recent Posts

  • 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)
  • What’s new in C++26 (part 2)
  • What’s new in C++26 (part 1)

Meta

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