After reading this article Storing C++ template function definitions in a .CPP file, I know that the definition of a class that uses template has to be written in the header fil
Yes, template-based C++ libraries expose their implementations. Providing source is not the same thing as "open source." Microsoft supplies the source to MFC, but it isn't open source. The license makes the difference.