How To Detect Function Overloads in C++17, std::from_chars Example

How to check if a function can be invoked? SFINAE? if constexpr?<img alt="" data-cke-saved-src="https://3.bp.blogspot.com/-LPhyXKA1CT8/XSQ-b9BNhgI/AAAAAAAAD2w/ooIxhAR8Q3wmu7xqq2-CTsU8bVLnGWvvACLcBGAs/s1600/funcoverload.png" src="https://3.bp.blogspot.com/-LPhyXKA1CT8/XSQ-b9BNhgI/AAAAAAAAD2w/ooIxhAR8Q3wmu7xqq2-CTsU8bVLnGWvvACLcBGAs/s1600/funcoverload.png" 300px;="" height:="" 96px;="" float:="" right;"="" style="height: 74px; width: 230px; float: right;">

How To Detect Function Overloads in C++17, std::from_chars Example

by Bartlomiej Filipek

From the article:

Working with real examples is better in most of the cases, so I like that we could show how the detection pattern works on a real function: std::from_chars. The full check used various of techniques: SFINAE, void_t, decltype, std::declval, std::true_type, std::false_type and partial template specialisation. Plus we even used if constexpr!

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.