Access maximum template depth at compile?
问题 In a certain compilation I need to play around with the option -ftemplate-depth=N that specifies the maximum template recursion. Is it possible to access the value of the maximum template depth from the program? I am interested in gcc or clang . $ c++ -ftemplate-depth=128 main.cpp #include<iostream> int main(){ std::cout << MAX_TEMPLATE_RECURSION << std::endl; // hypothetical name } 来源: https://stackoverflow.com/questions/36227436/access-maximum-template-depth-at-compile