concept compile - time in category c++

appears as: compile-time
Functional Programming in C++

This is an excerpt from Manning's book Functional Programming in C++.

You’re relying on the fact that function templates such as std::count_if don’t require arguments of specific types to be passed to them. They require only that the argument has all the features needed by the function template implementation. In this case, std::count_if requires the first two arguments to behave as forward iterators and the third argument to behave as a function. Some people call this a weakly typed part of C++, but that’s a misnomer. This is still strongly typed; it’s just that templates use duck-typing. There are no runtime checks of whether the type is a function object; all the needed checks are performed at compile-time.

Unlike the previous code snippet, this won’t produce an error at runtime because you’re playing with types at compile-time. decltype will never execute the code you pass to it; it just returns the type of the expression without evaluating it. Although this sounds great, the metafunction has two significant problems.