在编译时访问最大模板深度?

alf*_*lfC 6 c++ templates g++ compiler-options clang++

在某个编译中,我需要使用-ftemplate-depth=N指定最大模板递归的选项。

是否可以从程序中获取最大模板深度的值?

gcc我对或感兴趣clang

$ c++ -ftemplate-depth=128 main.cpp

#include<iostream>
int main(){
  std::cout << MAX_TEMPLATE_RECURSION << std::endl; // hypothetical name
}
Run Code Online (Sandbox Code Playgroud)