c++ - 在gcc或clang中调试SFINAE

标签 c++ templates gcc c++11 clang

我想知道在给定特定调用的情况下如何在编译时扩展我的模板,尤其是我有兴趣了解有关SFINAE的所有可能用法和行为的信息。

您知道gcc和/或clang中的一个或多个标志可以帮助我吗?

最佳答案

“SFINAE的所有可能行为”太含糊且太笼统。但是-如果您想了解编译器如何实例化代码中的模板,则可能对您有用:

**Templight* is a Clang-based tool to profile the time and memory consumption of template instantiations and to perform interactive debugging sessions to gain introspection into the template instantiation process.



Templight似乎是编译过程的前端部分,因此稍后,您可以使用名为templater的可视化工具。

警告:我没有尝试过自己做。

关于c++ - 在gcc或clang中调试SFINAE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24814238/

相关文章:

c++ - 为什么在 C++ 中使用非类型参数?

c++ - 在模板化类和函数 :-) 的上下文中,具有默认值的仿函数作为函数中的参数

c++ - lambda函数使用其参数作为模板参数调用模板函数

c++ - 重新定义 C++

c++ - STL排序题

c++ - 片段中的差异

c++ - gnu c++ 中是否有 __if_exists 的等价物?

c - 使用 GCC 交叉编译器时对 printf 的 undefined reference

GCC 中的 C 函数对齐

c++ - std::map emplace/insert 正在插入的移动值