It seems you are worried about code size.
Classes, and here I include instantiations of class templates, are just abstract pieces of information that the compiler knows about. They do not contribute to the code size.
Only functions, including member functions, contribute to code size. Member functions of class templates contribute to code size only when they are instantiated because the way in which they are used requires it (the C++ standard calls it "ODR-used").
In your examples, no member functions of std::is_function
and std::enable_if
are ODR-used, so they are not instantiated, and they do not contribute to code size.
But is that instantiation then written to the final build output?
No code is generated. But typically compilers write debugging information to the output. In that sense, something is written to the output.
And does this differ depending on compiler implementation?
As far as debugging information is concerned: yes. But whether an instantiation occurs is governed by the rules of the language, and there should not be a difference between compilers.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…