ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[c++11新特性,所有知识点都在这了](https://mp.weixin.qq.com/s/sWEBZzm6qmW2-LEw6Rdz3Q) [c++11实现c++14的optional](https://www.cnblogs.com/qicosmos/p/3577449.html) [An introduction to C++'s SFINAE concept: compile-time introspection of a class member](https://jguegant.github.io/blogs/tech/sfinae-introduction.html#sfinae-introduction) ***** ### 查看类是否定义了某个成员函数 [An introduction to C++’s SFINAE concept: compile-time introspection of a class member](https://jguegant.github.io/blogs/tech/sfinae-introduction.html) 详细介绍了从c98到c++17的做法 > #### 名词解释SFINAE     SFINAE是英文Substitution failure is not an error的缩写,意思是匹配失败不是错误。这句话什么意思呢?当调用模板函数时编译器会根据传入参数推导最合适的模板函数,在这个推导过程中如果某一个或者某几个模板函数推导出来是编译无法通过的,只要有一个可以正确推导出来,那么那几个推导得到的可能产生编译错误的模板函数并不会引发编译错误。这段话很绕,我们接下来用代码说明一下