根据此演示,模板不占用堆并且具有零开销。
这是真的吗,哪里可以查到?一般来说,如何确定您使用的 C++ 功能是否分配到堆?
演示链接
c++ templates heap-memory
c++ ×1
heap-memory ×1
templates ×1