Access maximum template depth at compile?

拈花ヽ惹草 提交于 2019-12-24 01:49:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!