C++ 模板元程序的 O 符号会怎样?

C++ What happens to a Template Metaprogram's O notation?

假设我将能够实现一个模板元程序 "search for a duplicate element in an array or any container" 或者说斐波那契模板元程序。我们知道,斐波那契的最佳情况下性能是 O(N^2) 和 O(2^N)。时间复杂度会发生什么变化,因为模板在编​​译时是 evaluated/loaded?它会变成 O(1) 还是取决于容器 O(N) 的元素数量?

Suppose that I will be able to implement a template metaprogram that will "search for a duplicate element in an array or any container"

为了使用模板元编程做到这一点,必须在编译时知道容器的内容

无法使用模板元编程将复杂性负担转移到 运行 时间。