Simplify code with 'if constexpr' in C++17dev.to/fenbf/simplify-code-with-if-constexpr-in-c17--2fnc An introduction to C++'s SFINAE concept: compile-time introspection of a class memberjguegant.github.io/blogs/tech/sfinae-introduction.html
1、constexpr产⽣背景 c++11以后,为了保证写出的代码⽐以往任何时候的执⾏效率都要好⽽进⾏了许多改善。其中,这种改善之⼀就是⽣成常量表达式,允许程序利⽤编译时的计算能⼒。常量表达式主要是允许⼀些计算发⽣在编译时期,⽽不是运⾏时期。这是⼀个很进步的优化:假如有些事情可以在编译...
Yesterday I played with constexpr if a little, using clang++ built from the latest LLVM sources. C++17 will not have many of the features I was looking forward to, but this is a really nice convenience. It lets us clean up some of those little templates-plus-specializations that only ...
the compiler currently supports C++11’s original rules for constexpr. C++14 extended constexpr will be implemented in the future, but not in 2015 RTM.In the STL, we’ve implemented every occurrence of