{"id":461748,"date":"2025-06-01T09:00:11","date_gmt":"2025-06-01T09:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=461748"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=461748","title":{"rendered":"<span>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c C++ \u0448\u0430\u0431\u043b\u043e\u043d\u044b: \u043e\u0442 \u0438\u043d\u043b\u0430\u0439\u043d\u0438\u043d\u0433\u0430 \u0434\u043e \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d\u044b \u0432 \u0421++ \u043e\u043f\u0430\u0441\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438, \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c.<\/p>\n<p>\u0421\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0435\u0441\u0442\u044c \u0438 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0438 \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043b\u0435\u0433\u043a\u043e, \u043a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 1: \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445<\/h2>\n<p>\u0423\u0436\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0430\u0447\u0435, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 <code>.h<\/code>, \u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u0432\u0430\u0442\u044c \u0432 <code>.cpp<\/code>. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>make_shared()<\/code>, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u041f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043e\u0431\u0435\u0449\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u0434\u0435-\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442, \u0435\u043c\u0443 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0447\u0435\u0440\u0442\u0435\u0436 \u0438\u043b\u0438 \u0441\u0445\u0435\u043c\u0443, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e&#8230;<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 &#8212; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u0422\u0430\u043a \u043b\u044e\u0431\u043e\u0439 <code>.cpp<\/code> \u0444\u0430\u0439\u043b, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u0445\u0435\u0434\u0435\u0440, \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">\/\/----------------------------- \/\/ File: TemplateUnit.cpp \/\/-----------------------------  #include \"TemplateUnit.hpp\" void SimpleClass::SimpleFunc() { puts(\"[SimpleClass::SimpleFunc]\"); }  \/\/----------------------------- \/\/ File: TemplateUnit.hpp \/\/-----------------------------  #pragma once #include \"stdio.h\"  struct SimpleClass {     void SimpleFunc();     template  void SimpleTemplateFunc(const T&amp;; value) {         printf(\"[SimpleTemplateFunc]: %d\\n\", value);     } };  template  struct TemplateClass {     void EasyFunc() { puts(\"[TemplateClass::EasyFunc]\"); }     template  void ComplexTemplateFunc(const T&amp;; value) {         printf(\"[ComplexTemplateFunc]: %d\\n\", value);     } };  \/\/----------------------------- \/\/ File: Alpha.cpp \/\/-----------------------------  #include \"Alpha.hpp\" #include \"TemplateUnit.hpp\" void AlphaLogic() {     SimpleClass().SimpleFunc();     SimpleClass().SimpleTemplateFunc(11);     TemplateClass().ComplexTemplateFunc(11); }  \/\/----------------------------- \/\/ File: Beta.cpp \/\/-----------------------------  #include \"Beta.hpp\" #include \"TemplateUnit.hpp\" void BetaLogic() {     SimpleClass().SimpleTemplateFunc(22);     TemplateClass().ComplexTemplateFunc(22); }  \/\/----------------------------- \/\/ File: Gamma.cpp \/\/-----------------------------  #include \"Gamma.hpp\" #include \"TemplateUnit.hpp\" void GammaLogic() {      SimpleClass().SimpleFunc();     TemplateClass().EasyFunc(); }  \/\/----------------------------- \/\/ File: Alpha.hpp \/\/-----------------------------  #pragma once void AlphaLogic();  \/\/----------------------------- \/\/ File: Beta.hpp \/\/-----------------------------  #pragma once void BetaLogic();  \/\/----------------------------- \/\/ File: Gamma.hpp \/\/-----------------------------  #pragma once void GammaLogic();  \/\/----------------------------- \/\/ File: main.cpp \/\/-----------------------------  #include \"Alpha.hpp\" #include \"Beta.hpp\" #include \"Gamma.hpp\"  int main() {     AlphaLogic();     BetaLogic();     GammaLogic(); }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 Linux-\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<pre><code class=\"bash\">g++ *.cpp -o main &amp;&amp; .\/main; rm main<\/code><\/pre>\n<p>GNU C++ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 (<code>g++<\/code>) \u0441\u043e\u0431\u0435\u0440\u0435\u0442 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b &#171;main&#187; (<code>-o main<\/code>) \u0438, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e (<code>&amp;&amp;<\/code>), \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b (<code>.\/main<\/code>).<\/p>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0451\u0442 <code>*.cpp<\/code> \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c <code>.cpp<\/code> \u0438 \u0432 \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 \u0438\u0445 \u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e. \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>;<\/code> (\u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u0431\u0435\u0437), \u043c\u044b \u0443\u0434\u0430\u043b\u0438\u043c (<code>rm<\/code>) \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b, \u0442.\u043a. \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d.<\/p>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 (\u0432 \u044d\u0442\u043e\u043c \u0438 \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445) \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">[SimpleClass::SimpleFunc] [SimpleTemplateFunc]: 11 [ComplexTemplateFunc]: 11 [SimpleTemplateFunc]: 22 [ComplexTemplateFunc]: 22 [SimpleClass::SimpleFunc] [TemplateClass::EasyFunc]<\/code><\/pre>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 <code>.cpp<\/code> \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b <code>.o<\/code> \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435.<\/p>\n<pre><code class=\"bash\">g++ -c *.cpp &amp;&amp; for f in *.o; do echo -e \"\\n--- $f ---\"; nm \"$f\" | grep -E 'SimpleClass|TemplateClass' | c++filt; done; rm *.o<\/code><\/pre>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 GCC, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c <code>-c<\/code>, \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e <code>.cpp<\/code> \u0432 \u043f\u0430\u043f\u043a\u0435.<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0446\u0438\u043a\u043b\u0430 <code>for<\/code> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <code>*.o<\/code> \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0440\u044f\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p><code>echo -e \"\\n--- $f ---\"<\/code> \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430. \u0424\u043b\u0430\u0433 <code>-e<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c escape-\u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>\\n<\/code> \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <code>nm<\/code>. \u041e\u043d\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <code>\"$f\"<\/code> .<\/p>\n<p>\u041f\u0430\u0439\u043f-\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>|<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u0438\u0437 <code>nm<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043d\u0435 \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <code>SimpleClass<\/code> \u0438 <code>TemplateClass<\/code>.<\/p>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 <code>grep<\/code> (Global Regular Expression Print) \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 \u0432\u044b\u0432\u043e\u0434, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 <code>nm<\/code>, \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u043b\u044e\u0431\u043e\u0435 \u0438\u0437 \u0438\u043c\u0435\u043d \u044d\u0442\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<p>\u0424\u043b\u0430\u0433 <code>-E<\/code> \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>|<\/code>(OR) \u0431\u0435\u0437 \u0440\u0430\u0437\u0434\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0439 \u0447\u0435\u0440\u0442\u043e\u0447\u043a\u0438 (<code>\\<\/code>) \u043f\u0435\u0440\u0435\u0434 \u043d\u0438\u043c.<\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <code>c++filt<\/code>. \u041e\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u0442 <strong>\u0434\u0435\u043c\u0430\u043d\u0433\u043b\u0438\u043d\u0433<\/strong>, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0435\u0439 \u0438\u043c\u0435\u043d\u0430 \u0432 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442. \u0422\u0430\u043a, \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 <code><em>ZN13TemplateClassIiE19ComplexTemplateFuncIiEEvRKT<\/em><\/code>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0447\u0442\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c (<code>done<\/code>), \u043c\u044b \u0443\u0434\u0430\u043b\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0447\u0435\u0440\u0435\u0437 <code>rm *.o<\/code>.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">--- Alpha.o ---                  U SimpleClass::SimpleFunc() 0000000000000000 W void SimpleClass::SimpleTemplateFunc(int const&amp;) 0000000000000000 W void TemplateClass::ComplexTemplateFunc(int const&amp;)  --- Beta.o --- 0000000000000000 W void SimpleClass::SimpleTemplateFunc(int const&amp;) 0000000000000000 W void TemplateClass::ComplexTemplateFunc(int const&amp;)  --- Gamma.o ---                  U SimpleClass::SimpleFunc() 0000000000000000 W TemplateClass::EasyFunc()  --- TemplateUnit.o --- 0000000000000000 T SimpleClass::SimpleFunc()  --- main.o --- <\/code><\/pre>\n<ol>\n<li>\n<p>\u041e\u0441\u043e\u0431\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <code>SimpleClass::SimpleFunc()<\/code> &#8212; \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0447\u0438\u0445, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>TemplateUnit.cpp<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u0435\u0442\u043a\u0430 <code>T<\/code>(text) \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u0441 \u0441\u0438\u043b\u044c\u043d\u044b\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0430 \u0432\u0435\u0441\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b (\u043d\u0430 \u0442\u043e \u043e\u043d \u0438 \u0441\u0438\u043b\u044c\u043d\u044b\u0439).<\/p>\n<p>\u041c\u0435\u0442\u043a\u0430 <code>U<\/code>(undefined) \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043d\u043e \u0435\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0433\u0434\u0435-\u0442\u043e \u0432\u043e\u0432\u043d\u0435.<\/p>\n<p>\u0422\u0430\u043a, \u0444\u0430\u0439\u043b\u044b <code>Alpha.o<\/code> \u0438 <code>Gamma.o<\/code> \u0437\u043d\u0430\u044e\u0442 \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 <code>SimpleClass::SimpleFunc()<\/code>, \u043d\u043e \u043d\u0435 \u043e \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0438. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u044d\u0442\u0438 <code>.cpp<\/code> \u0444\u0430\u0439\u043b\u044b \u0438\u043c\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0445\u0435\u0434\u0435\u0440\u0435.<\/p>\n<p>\u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043b\u0438\u043d\u043a\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f undefined-\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0438\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442, \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0414\u043b\u0438\u043d\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0443\u043b\u0435\u0439 \u0440\u044f\u0434\u043e\u043c \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c \u0435\u0449\u0451 \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d. \u041c\u044b \u0432\u0435\u0434\u044c \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u043f\u043e \u0441\u0443\u0442\u0438, \u043f\u043e\u043b\u0443\u0444\u0430\u0431\u0440\u0438\u043a\u0430\u0442\u0430\u043c\u0438.<\/p>\n<ol start=\"2\">\n<li>\n<p>\u041c\u0435\u0442\u043a\u0430 <code>W<\/code>(weak) \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <strong>\u0441\u043b\u0430\u0431\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/strong> \u0441\u0438\u043c\u0432\u043e\u043b\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>&#171;\u0421\u043b\u0430\u0431\u043e\u0441\u0442\u044c&#187; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u0438\u043d\u043a\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u043d\u0435\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432\u043e\u0435\u0434\u0438\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u043d\u043a\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u0442 \u0435\u0433\u043e \u0437\u0430 \u043e\u0431\u0440\u0430\u0437\u0435\u0446, \u0430 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0433\u043e &#8212; \u0432\u043e\u0437\u044c\u043c\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u0430\u0431\u044b\u0439, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e, \u0438\u0437 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u0430\u0431\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0412\u0441\u0435 \u0441\u043b\u0430\u0431\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 &#8212; \u044d\u0442\u043e <strong>\u043d\u0435\u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438<\/strong>, \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043b\u0430\u0441\u0441\u044b, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041d\u0435\u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 &#8212; \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u043e\u0435 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 <code>.cpp<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 <code>TemplateUnit.hpp<\/code>, \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 <code>Alpha.o<\/code>, <code>Beta.o<\/code>, <code>Gamma.o<\/code> &#8212; \u043f\u0440\u044f\u043c\u0430\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430.<\/p>\n<blockquote>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u044e\u043d\u0438\u0442\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u043b\u0438\u0448\u043d\u044e\u044e \u0440\u0430\u0431\u043e\u0442\u0443!<br \/>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u043f\u0440\u043e\u0438\u0437\u0432\u0451\u043b \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434.<br \/>\u041b\u0438\u043d\u043a\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442 \u0432\u0441\u0435 \u043f\u043b\u043e\u0434\u044b \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<\/blockquote>\n<p>\u0412 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u0432\u0440\u0435\u043c\u044f \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0437\u0440\u044f, \u043d\u0438\u0447\u0442\u043e\u0436\u043d\u044b.<\/p>\n<p>\u041d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0442\u043d\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0442\u044b\u0441\u044f\u0447\u0438, \u044e\u043d\u0438\u0442\u043e\u0432 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0441 \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0435 \u0437\u0430 \u043c\u0438\u043d\u0443\u0442\u0443, \u0430 \u0437\u0430 \u043f\u044f\u0442\u044c; \u043d\u0435 \u0437\u0430 \u043f\u044f\u0442\u044c, \u0430 \u0437\u0430 \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u0435\u0442, \u0431\u0438\u0437\u043d\u0435\u0441 \u0442\u0435\u0440\u044f\u0435\u0442 \u0434\u0435\u043d\u044c\u0433\u0438.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0443 \u0434\u043e\u043b\u0433\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0435\u0441\u0442\u044c \u0438 \u0438\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b. \u041d\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u0432\u043a\u043b\u0430\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c.<\/p>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 2: \u0418\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u044b \u0432 \u0445\u0435\u0434\u0435\u0440\u0435<\/h2>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u0435\u043d \u043f\u0435\u0440\u0432\u043e\u043c\u0443, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0440\u044f\u0442\u043d\u044b\u043c. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u0430 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u043e\u0432 \u0442\u0435\u0445, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u044b\u0448\u0430\u043b \u043e \u043d\u0438\u0445.<\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043e\u0431\u0449\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435, \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041d\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u044e\u0431\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>TemplateUnit.inl<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0438\u043d\u043a\u043b\u0443\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 <code>TemplateUnit.hpp<\/code>. \u0422\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u0437 <code>.inl<\/code> \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e <code>.hpp<\/code>.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u041f\u043e\u0434\u0445\u043e\u0434\u0435 1, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f.<\/p>\n<pre><code class=\"cpp\">\/\/----------------------------- \/\/ File: TemplateUnit.hpp \/\/-----------------------------  #pragma once  struct SimpleClass {     void SimpleFunc();     template  void SimpleTemplateFunc(const T&amp; value); };  template  struct TemplateClass {     void EasyFunc();     template  void ComplexTemplateFunc(const T&amp; value); };  #include \"TemplateUnit.inl\"  \/\/----------------------------- \/\/ File: TemplateUnit.inl \/\/-----------------------------  #pragma once #include \"stdio.h\"  template  void SimpleClass::SimpleTemplateFunc(const T&amp; value) {     printf(\"[SimpleTemplateFunc]: %d\\n\", value); }  template  void TemplateClass::EasyFunc() { puts(\"[TemplateClass::EasyFunc]\"); }  template template void TemplateClass::ComplexTemplateFunc(const T&amp; value) {     printf(\"[ComplexTemplateFunc]: %d\\n\", value); }  \/\/----------------------------- \/\/ Other files are identical to Approach 1 \/\/-----------------------------<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <code>.inl<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0441\u0438\u043b\u0443 \u0435\u0433\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 GCC, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0430\u0442\u044c \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u0443 \u043b\u044e\u0431\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435: <code>.txt<\/code>, <code>.jpg<\/code>&#8230; \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <code>TemplateUnit.inl<\/code> \u0432 <code>TemplateUnit.hpp<\/code>.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0442\u0435 \u0436\u0435 \u0434\u0432\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445, \u0447\u0442\u043e \u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437.<\/p>\n<p>\u0412\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u044e\u043d\u0438\u0442\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435.<\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0445\u0435\u0434\u0435\u0440\u0430, \u043f\u0443\u0441\u0442\u044c \u0438 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u0415\u0441\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c <code>.cpp<\/code>, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0438\u0445 \u0432\u043d\u0435 \u0442\u0435\u043b\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong>:<br \/>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u0430 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u043c, \u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442.<\/p>\n<\/blockquote>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 3: \u0418\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u044b \u0432 .cpp<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u0432 \u0445\u0435\u0434\u0435\u0440 (\u0438 \u043e\u0442\u0442\u0443\u0434\u0430 \u0432\u043e \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0435\u0433\u043e \u044e\u043d\u0438\u0442\u044b \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438), \u043d\u043e \u043b\u0438\u0448\u044c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 <code>.cpp<\/code> \u0444\u0430\u0439\u043b\u044b.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">\/\/----------------------------- \/\/ File: TemplateUnit.hpp \/\/-----------------------------  #pragma once  struct SimpleClass {     void SimpleFunc();     template  void SimpleTemplateFunc(const T&amp; value); };  template  struct TemplateClass {     void EasyFunc();     template  void ComplexTemplateFunc(const T&amp; value); };  \/\/----------------------------- \/\/ File: TemplateUnit.inl \/\/-----------------------------  #pragma once #include \"stdio.h\"  template  void SimpleClass::SimpleTemplateFunc(const T&amp; value) {     printf(\"[SimpleTemplateFunc]: %d\\n\", value); }  template  void TemplateClass::EasyFunc() { puts(\"[TemplateClass::EasyFunc]\"); }  template template void TemplateClass::ComplexTemplateFunc(const T&amp; value) {     printf(\"[ComplexTemplateFunc]: %d\\n\", value); }  \/\/----------------------------- \/\/ File: Alpha.cpp \/\/-----------------------------  #include \"Alpha.hpp\" #include \"TemplateUnit.hpp\" #include \"TemplateUnit.inl\" void AlphaLogic() {     SimpleClass().SimpleFunc();     SimpleClass().SimpleTemplateFunc(11);     TemplateClass().ComplexTemplateFunc(11); }  \/\/----------------------------- \/\/ File: Beta.cpp \/\/-----------------------------  #include \"Beta.hpp\" #include \"TemplateUnit.hpp\"  extern template void SimpleClass::SimpleTemplateFunc(const int&amp;); extern template void TemplateClass::ComplexTemplateFunc(const int&amp;);  void BetaLogic() {     SimpleClass().SimpleTemplateFunc(22);     TemplateClass().ComplexTemplateFunc(22); }  \/\/----------------------------- \/\/ File: Gamma.cpp \/\/-----------------------------  #include \"Gamma.hpp\" #include \"TemplateUnit.hpp\" #include \"TemplateUnit.inl\" void GammaLogic() {      SimpleClass().SimpleFunc();     TemplateClass().EasyFunc(); }  \/\/----------------------------- \/\/ Other files are identical to Approach 2 \/\/-----------------------------<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code class=\"bash\">--- Alpha.o ---                  U SimpleClass::SimpleFunc() 0000000000000000 W void SimpleClass::SimpleTemplateFunc(int const&amp;) 0000000000000000 W void TemplateClass::ComplexTemplateFunc(int const&amp;)  --- Beta.o ---                  U void SimpleClass::SimpleTemplateFunc(int const&amp;)                  U void TemplateClass::ComplexTemplateFunc(int const&amp;)  --- Gamma.o ---                  U SimpleClass::SimpleFunc() 0000000000000000 W TemplateClass::EasyFunc()  --- TemplateUnit.o --- 0000000000000000 T SimpleClass::SimpleFunc()  --- main.o ---<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 <code>TemplateUnit.inl<\/code> \u043b\u0438\u0448\u044c \u0432 \u0444\u0430\u0439\u043b\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>Alpha.cpp<\/code> \u0438 <code>Gamma.cpp<\/code>.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u044e\u043d\u0438\u0442\u044b \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 <code>Alpha<\/code> \u0438 <code>Gamma<\/code> \u0438\u043c\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c. \u0417\u0430 \u0441\u0447\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u043b \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438 (\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f) \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u044d\u0442\u0438\u0445 <code>.cpp<\/code> \u0444\u0430\u0439\u043b\u0430\u0445.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043c\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043b\u0438 <code>extern template<\/code> \u0432 <code>Beta.cpp<\/code> \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>extern template<\/code>, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430.<\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043b\u0438\u0448\u044c \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e <code>extern template<\/code> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u044e\u043d\u0438\u0442\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438, \u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043e\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041d\u043e \u043f\u043e\u0434\u0445\u043e\u0434 \u044d\u0442\u043e\u0442 \u044f\u0432\u043d\u043e \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u043e \u0432\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043b\u0438\u0448\u044c \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b. \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u043d\u043e\u0432\u043e\u043c <code>.cpp<\/code>, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0445\u043e\u0442\u044c \u043e\u0434\u0438\u043d \u0448\u0430\u0431\u043b\u043e\u043d, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0436\u043e\u043d\u0433\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0412\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 <code>.inl<\/code> \u0438 <code>extern template<\/code> \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d. \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435\u0432\u044b\u043d\u043e\u0441\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0439, \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0441\u043b\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u044e\u043d\u0438\u0442\u043e\u0432 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0435\u0440\u0435\u0432\u0430\u043b\u0438\u0442 \u0437\u0430 \u0434\u0435\u0441\u044f\u0442\u043e\u043a.<\/p>\n<blockquote>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong>:<br \/>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 <code>.cpp<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u041c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c, \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0435\u0434\u0432\u0430 \u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c.<\/p>\n<\/blockquote>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 4: \u042f\u0432\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/h2>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c <strong>\u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430<\/strong> \u043a\u0430\u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0442\u0438\u043f\u0430.<\/p>\n<p>\u0422\u0430\u043a, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0432 <code>.cpp<\/code> \u0444\u0430\u0439\u043b\u0430\u0445 &#8212; \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0432\u044b\u0437\u044b\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8212; \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0439 <code>\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439<\/code>, \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0434\u043b\u044f <code>int<\/code>.<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u0445 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 <strong>\u043d\u0435\u044f\u0432\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u044f\u043c\u0438<\/strong> &#8212; \u043c\u044b \u043d\u0438\u0433\u0434\u0435 \u0432 \u043a\u043e\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0438, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <code>TemplateClass::EasyFunc()<\/code>. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f (\u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u044f \u0434\u043b\u044f <code>int<\/code>) \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043d\u0430\u0448 \u0432\u044b\u0437\u043e\u0432 <code>EasyFunc()<\/code> \u0432 <code>Gamma.cpp<\/code>.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, <strong>\u044f\u0432\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u044f<\/strong> &#8212; \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443:<\/p>\n<pre><code class=\"cpp\">\/\/----------------------------- \/\/ File: TemplateUnit.cpp \/\/-----------------------------  #include \"stdio.h\" #include \"TemplateUnit.hpp\"  void SimpleClass::SimpleFunc() { puts(\"[SimpleClass::SimpleFunc]\"); }  template  void SimpleClass::SimpleTemplateFunc(const T&amp; value) {     printf(\"[SimpleTemplateFunc]: %d\\n\", value); }  template  void TemplateClass::EasyFunc() { puts(\"[NonTemplateFuncInTemplateClass]\"); }  template template void TemplateClass::ComplexTemplateFunc(const T&amp; value) {     printf(\"[ComplexTemplateFunc]: %d\\n\", value); }  template void TemplateClass::EasyFunc(); template void SimpleClass::SimpleTemplateFunc(const int&amp;); template void TemplateClass::ComplexTemplateFunc(const int&amp;);  \/\/----------------------------- \/\/ File: TemplateUnit.hpp \/\/-----------------------------  #pragma once  struct SimpleClass {     void SimpleFunc();     template  void SimpleTemplateFunc(const T&amp; value); };  template  struct TemplateClass {     void EasyFunc();     template  void ComplexTemplateFunc(const T&amp; value); };  extern template void TemplateClass::EasyFunc(); extern template void SimpleClass::SimpleTemplateFunc(const int&amp;); extern template void TemplateClass::ComplexTemplateFunc(const int&amp;);  \/\/----------------------------- \/\/ Other files are identical to Approach 1 \/\/-----------------------------<\/code><\/pre>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435:<\/p>\n<pre><code class=\"bash\">--- Alpha.o ---                  U SimpleClass::SimpleFunc()                  U void SimpleClass::SimpleTemplateFunc(int const&amp;)                  U void TemplateClass::ComplexTemplateFunc(int const&amp;)  --- Beta.o ---                  U void SimpleClass::SimpleTemplateFunc(int const&amp;)                  U void TemplateClass::ComplexTemplateFunc(int const&amp;)  --- Gamma.o ---                  U SimpleClass::SimpleFunc()                  U TemplateClass::EasyFunc()  --- TemplateUnit.o --- 0000000000000000 T SimpleClass::SimpleFunc() 0000000000000000 W void SimpleClass::SimpleTemplateFunc(int const&amp;) 0000000000000000 W void TemplateClass::ComplexTemplateFunc(int const&amp;) 0000000000000000 W TemplateClass::EasyFunc()  --- main.o ---<\/code><\/pre>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 <code>template void TemplateClass::EasyFunc();<\/code>, \u0432 <code>TemplateUnit.cpp<\/code> \u044d\u0442\u043e <strong>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/strong> (explicit instantiation definition).<\/p>\n<p>\u042f\u0432\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0442\u0438\u043f\u043e\u0432. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u044e\u043d\u0438\u0442\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438. \u0422\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0442 \u043f\u0430\u0443\u0442\u0438\u043d\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u0435\u043b\u0430 \u043c\u0435\u0441\u0442\u043e \u0432 \u041f\u043e\u0434\u0445\u043e\u0434\u0435 3.<\/p>\n<p>\u041a\u0430\u043a \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b <code>Alpha.o<\/code>, <code>Beta.o<\/code>, <code>Gamma.o<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043b\u0438\u0448\u044c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0418\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u0432 <code>TemplateUnit.o<\/code>.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, <code>extern template void TemplateClass::EasyFunc();<\/code> \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 <code>TemplateUnit.hpp<\/code> &#8212; \u044d\u0442\u043e <strong>\u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/strong> (explicit instantiation declaration).<\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>extern template<\/code> \u043c\u044b \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043b\u044f <code>int<\/code> \u0432 \u044d\u0442\u043e\u043c \u044e\u043d\u0438\u0442\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0438 \u043e\u0431\u0435\u0449\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438 (\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f) \u043b\u0438\u043d\u043a\u0435\u0440 \u043d\u0430\u0439\u0434\u0435\u0442 \u0432 \u0438\u043d\u043e\u043c \u044e\u043d\u0438\u0442\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438.<\/p>\n<p>\u041d\u0430\u0434\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GCC 15.1, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>extern template<\/code> \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b. \u0415\u0441\u043b\u0438 \u0438\u0445 \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<p>\u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0440\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0432\u043e\u0432\u0441\u0435. \u042d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a!<\/p>\n<p>\u041f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 <code>extern template<\/code> \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043c\u044b \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043d\u0430 \u0432\u043e\u043b\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. GCC \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043c\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u0438\u0448\u043d\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0431\u0435\u0437 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a. \u041d\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043e, \u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439, \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0442\u0430\u043a\u0436\u0435.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u0414\u0430, \u043f\u043e\u0434\u0445\u043e\u0434 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442 \u043d\u0430\u0441 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u041f\u043e\u0434\u0445\u043e\u0434\u0430 3.<\/p>\n<p>\u041d\u0430\u0434\u043e \u0442\u0430\u043a\u0436\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b <code>extern template<\/code> \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 <code>template<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c \u043f\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u0442\u0438\u043f\u0430\u043c \u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0435. \u041d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043d\u0435\u044f\u0432\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u044f\u043c \u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">g++ -fno-implicit-templates *.cpp -o main &amp;&amp; .\/main; rm main  g++ -fno-implicit-templates -c *.cpp &amp;&amp; for f in *.o; do echo -e \"\\n--- $f ---\"; nm \"$f\" | grep -E 'SimpleClass|TemplateClass' | c++filt; done; rm *.o<\/code><\/pre>\n<p>\u0424\u043b\u0430\u0433 <code>-fno-implicit-templates<\/code> \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438, \u0432\u043e\u0437\u043b\u0430\u0433\u0430\u044f \u044d\u0442\u043e \u0431\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u043b\u0435\u0447\u0438 \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u043e\u0434\u0430. \u0424\u043b\u0430\u0433 \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u043e\u0442 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u044f\u043c\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438, \u0436\u0430\u043b\u0443\u044f\u0441\u044c \u043d\u0430 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u044e\u043d\u0438\u0442\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 <code>Alpha<\/code>, <code>Beta<\/code>, <code>Gamma<\/code>.<\/p>\n<blockquote>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong>:<br \/>\u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0445 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 &#8212; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c <code>.cpp<\/code>, \u0430 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 <code>extern template<\/code> \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/blockquote>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 5. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 C++20 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h2>\n<p>\u0411\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c C++20 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0442\u0435\u043c\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u043e\u0432\u0438\u0437\u043d\u0443 \u0438 \u043a\u0430\u0436\u0443\u0449\u0443\u044e\u0441\u044f \u0447\u0443\u0436\u0434\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043e\u0431\u0449\u0438\u0435 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0438\u043c\u0438: \u043d\u0430\u043c \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0438\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0437\u0430 \u043d\u0430\u0441.<\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438, \u043c\u044b \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0430 \u043d\u0435 \u0432 \u0434\u0432\u0443\u0445.<\/p>\n<pre><code class=\"cpp\">\/\/----------------------------- \/\/ File: TemplateUnit.cppm \/\/-----------------------------  module; import ; export module TemplateModule; export {     struct SimpleClass {         void SimpleFunc();          template          void SimpleTemplateFunc(const T&amp; value) {             printf(\"[SimpleTemplateFunc]: %d\\n\", value);         }     };          template      struct TemplateClass {         void EasyFunc() { puts(\"[TemplateClass::EasyFunc]\"); }          template          void ComplexTemplateFunc(const T&amp; value) {             printf(\"[ComplexTemplateFunc]: %d\\n\", value);         }     };      void SimpleClass::SimpleFunc() {         puts(\"[SimpleClass::SimpleFunc]\");     } } \/\/ export  template void SimpleClass::SimpleTemplateFunc(const int&amp;); template void TemplateClass::EasyFunc(); template void TemplateClass::ComplexTemplateFunc(const int&amp;);  \/\/----------------------------- \/\/ File: Alpha.cpp \/\/-----------------------------  import TemplateModule; #include \"Alpha.hpp\" void AlphaLogic() {     SimpleClass().SimpleFunc();     SimpleClass().SimpleTemplateFunc(11);     TemplateClass().ComplexTemplateFunc(11); }  \/\/----------------------------- \/\/ File: Beta.cpp \/\/-----------------------------  import TemplateModule; #include \"Beta.hpp\" void BetaLogic() {     SimpleClass().SimpleTemplateFunc(22);     TemplateClass().ComplexTemplateFunc(22); }  \/\/----------------------------- \/\/ File: Gamma.cpp \/\/-----------------------------  import TemplateModule; #include \"Gamma.hpp\" void GammaLogic() {      SimpleClass().SimpleFunc();     TemplateClass().EasyFunc(); }  \/\/----------------------------- \/\/ Other files are identical to Approach 1 \/\/----------------------------- <\/code><\/pre>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u0430\u0441\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <strong>\u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/strong>:<\/p>\n<ol>\n<li>\n<p>\u0422\u0430\u043a\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043c\u044b \u0434\u0430\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 <code>TemplateModule.cppm<\/code>, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0445\u043e\u0434\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041a\u0430\u043a \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 <code>.inl<\/code>, \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <code>.cppm<\/code> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0430\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043c\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043c\u043e\u0434\u0443\u043b\u044f (<code>module;<\/code>) \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 (<code>import ;<\/code>), \u0447\u0442\u043e\u0431\u044b \u043d\u0438\u0436\u0435 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>printf()<\/code> \u0438 <code>puts()<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>export module TemplateModule;<\/code> \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c <code>TemplateModule<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0438 \u0444\u0430\u0439\u043b\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0440\u043e\u0447\u043a\u043e\u0439 <code>export {<\/code> \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0439 \u043e <strong>\u0441\u0432\u044f\u0437\u0438 \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/strong>:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b &#8212; \u0431\u0435\u0437 \u043d\u0438\u0445, \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 (<code>extern template<\/code>) \u0437\u0434\u0435\u0441\u044c \u0438\u0437\u043b\u0438\u0448\u043d\u0438 &#8212; \u043a\u0430\u0436\u0434\u044b\u0439 \u044e\u043d\u0438\u0442 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 <code>TemplateModule<\/code>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435, \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 (<code>template<\/code> \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 <code>TemplateUnit.cppm<\/code>) \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442\u0430\u043a \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 <code>export {}<\/code>. <strong>\u042d\u043a\u0441\u043f\u043e\u0440\u0442<\/strong> \u043b\u0438\u0448\u044c \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u044e\u043d\u0438\u0442\u0430 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438. \u041c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c, \u043e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e <strong>\u0434\u043e\u0441\u044f\u0433\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/strong> (<em>reachability<\/em>), \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u043e\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0433\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432:<\/p>\n<pre><code class=\"bash\">F=\"g++ -std=c++20 -fmodules-ts -fno-implicit-templates\"; $F -x c++-system-header stdio.h &amp;&amp; $F -c *.cppm &amp;&amp; $F *.o *.cpp -o main &amp;&amp; .\/main; rm main *.o  g++ -std=c++20 -fmodules-ts -c *.cppm *.cpp &amp;&amp; for f in *.o; do echo -e \"\\n--- $f ---\"; nm \"$f\" | grep -E 'SimpleClass|TemplateClass' | c++filt; done; rm *.o<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>F=\"g++ -std=c++20 -fmodules-ts -fno-implicit-templates\"<\/code>, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0440\u0451\u0445\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>F<\/code> \u043f\u0440\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u0437\u0430\u043a\u0440\u043e\u0435\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b.<\/p>\n<p>\u0424\u043b\u0430\u0433 <code>-std=c++20<\/code> \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 C++20 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0412 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e C++17 \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b.<\/p>\n<p>\u0424\u043b\u0430\u0433 <code>-fmodules-ts<\/code> \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0434\u0430\u0436\u0435 \u043d\u043e\u0432\u0435\u0439\u0448\u0438\u0439 GCC 15.1 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0438\u0447\u0435\u0439.<\/p>\n<p>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 <code>-x c++-system-header stdio.h<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0421\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>stdio.h<\/code> \u0432 \u043c\u043e\u0434\u0443\u043b\u044c, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0443\u0436\u0435 \u0432 \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0443 \u043d\u0430\u0441 \u0432 \u041f\u043e\u0434\u0445\u043e\u0434\u0435 4.<\/p>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u0445 \u0442\u0438\u043f\u043e\u0432 (<code>SimpleClass@TemplateModule::SimpleFunc()<\/code>) &#8212; \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b.<\/p>\n<blockquote>\n<p><strong>\u0412\u044b\u0432\u043e\u0434<\/strong>:<br \/>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 C++20 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043f\u0443\u0441\u0442\u044c \u0438 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0443\u0441\u0438\u043b\u0438\u0439, \u0447\u0435\u043c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u044f\u0432\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0439.<\/p>\n<\/blockquote>\n<hr\/>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0447\u0440\u0435\u0432\u0430\u0442\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0437-\u0437\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u044e\u043d\u0438\u0442\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0442\u0440\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c.<\/p>\n<p>\u0424\u0430\u0439\u043b\u044b \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/github.com\/MangoFalls\/ARTICLES\/tree\/main\/004_OptimizingTemplates\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/MangoFalls\/ARTICLES\/tree\/main\/004_OptimizingTemplates<\/a><\/p>\n<h2>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/lugdunum3d.github.io\/doc\/guidelines.html\" rel=\"noopener noreferrer nofollow\">https:\/\/lugdunum3d.github.io\/doc\/guidelines.html<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/timsong-cpp.github.io\/cppwp\/n4861\/module.reach\" rel=\"noopener noreferrer nofollow\">https:\/\/timsong-cpp.github.io\/cppwp\/n4861\/module.reach<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/class_template\" rel=\"noopener noreferrer nofollow\">https:\/\/en.cppreference.com\/w\/cpp\/language\/class_template<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/gcc.gnu.org\/onlinedocs\/gcc-15.1.0\/gcc\/Template-Instantiation.html\" rel=\"noopener noreferrer nofollow\">https:\/\/gcc.gnu.org\/onlinedocs\/gcc-15.1.0\/gcc\/Template-Instantiation.html<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/1208028\/significance-of-a-inl-file-in-c\" rel=\"noopener noreferrer nofollow\">https:\/\/stackoverflow.com\/questions\/1208028\/significance-of-a-inl-file-in-c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/cpp\/cpp\/source-code-organization-cpp-templates\" rel=\"noopener noreferrer nofollow\">https:\/\/learn.microsoft.com\/en-us\/cpp\/cpp\/source-code-organization-cpp-templates<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/forums.unrealengine.com\/t\/can-inline-files-inl-be-included-from-a-ue4-header-file\/396446\" rel=\"noopener noreferrer nofollow\">https:\/\/forums.unrealengine.com\/t\/can-inline-files-inl-be-included-from-a-ue4-header-file\/396446<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/developercommunity.visualstudio.com\/t\/intellisense-if-inl-file-with-inline-method-defini\/158288\" rel=\"noopener noreferrer nofollow\">https:\/\/developercommunity.visualstudio.com\/t\/intellisense-if-inl-file-with-inline-method-defini\/158288<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.reddit.com\/r\/cpp_questions\/comments\/1bcyci3\/why_is_there_need_to_use_a_inl_file_after_using\/\" rel=\"noopener noreferrer nofollow\">https:\/\/www.reddit.com\/r\/cpp_questions\/comments\/1bcyci3\/why_is_there_need_to_use_a_inl_file_after_using\/<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/914632\/\"> https:\/\/habr.com\/ru\/articles\/914632\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d\u044b \u0432 \u0421++ \u043e\u043f\u0430\u0441\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u043e\u0441\u0440\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438, \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c.<\/p>\n<p>\u0421\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0435\u0441\u0442\u044c \u0438 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0438 \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043b\u0435\u0433\u043a\u043e, \u043a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 1: \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445<\/h2>\n<p>\u0423\u0436\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0430\u0447\u0435, \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 <code>.h<\/code>, \u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u0432\u0430\u0442\u044c \u0432 <code>.cpp<\/code>. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>make_shared()<\/code>, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u041f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043e\u0431\u0435\u0449\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u0434\u0435-\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442, \u0435\u043c\u0443 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0447\u0435\u0440\u0442\u0435\u0436 \u0438\u043b\u0438 \u0441\u0445\u0435\u043c\u0443, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e&#8230;<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 &#8212; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u0422\u0430\u043a \u043b\u044e\u0431\u043e\u0439 <code>.cpp<\/code> \u0444\u0430\u0439\u043b, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u0445\u0435\u0434\u0435\u0440, \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">\/\/----------------------------- \/\/ File: TemplateUnit.cpp \/\/-----------------------------  #include \"TemplateUnit.hpp\" void SimpleClass::SimpleFunc() { puts(\"[SimpleClass::SimpleFunc]\"); }  \/\/----------------------------- \/\/ File: TemplateUnit.hpp \/\/-----------------------------  #pragma once #include \"stdio.h\"  struct SimpleClass {     void SimpleFunc();     template  void SimpleTemplateFunc(const T&amp;; value) {         printf(\"[SimpleTemplateFunc]: %d\\n\", value);     } };  template  struct TemplateClass {     void EasyFunc() { puts(\"[TemplateClass::EasyFunc]\"); }     template  void ComplexTemplateFunc(const T&amp;; value) {         printf(\"[ComplexTemplateFunc]: %d\\n\", value);     } };  \/\/----------------------------- \/\/ File: Alpha.cpp \/\/-----------------------------  #include \"Alpha.hpp\" #include \"TemplateUnit.hpp\" void AlphaLogic() {     SimpleClass().SimpleFunc();     SimpleClass().SimpleTemplateFunc(11);     TemplateClass().ComplexTemplateFunc(11); }  \/\/----------------------------- \/\/ File: Beta.cpp \/\/-----------------------------  #include \"Beta.hpp\" #include \"TemplateUnit.hpp\" void BetaLogic() {     SimpleClass().SimpleTemplateFunc(22);     TemplateClass().ComplexTemplateFunc(22); }  \/\/----------------------------- \/\/ File: Gamma.cpp \/\/-----------------------------  #include \"Gamma.hpp\" #include \"TemplateUnit.hpp\" void GammaLogic() {      SimpleClass().SimpleFunc();     TemplateClass().EasyFunc(); }  \/\/----------------------------- \/\/ File: Alpha.hpp \/\/-----------------------------  #pragma once void AlphaLogic();  \/\/----------------------------- \/\/ File: Beta.hpp \/\/-----------------------------  #pragma once void BetaLogic();  \/\/----------------------------- \/\/ File: Gamma.hpp \/\/-----------------------------  #pragma once void GammaLogic();  \/\/----------------------------- \/\/ File: main.cpp \/\/-----------------------------  #include \"Alpha.hpp\" #include \"Beta.hpp\" #include \"Gamma.hpp\"  int main() {     AlphaLogic();     BetaLogic();     GammaLogic(); }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 Linux-\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<pre><code class=\"bash\">g++ *.cpp -o main &amp;&amp; .\/main; rm main<\/code><\/pre>\n<p>GNU C++ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 (<code>g++<\/code>) \u0441\u043e\u0431\u0435\u0440\u0435\u0442 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b &#171;main&#187; (<code>-o main<\/code>) \u0438, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e (<code>&amp;&amp;<\/code>), \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b (<code>.\/main<\/code>).<\/p>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0451\u0442 <code>*.cpp<\/code> \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c <code>.cpp<\/code> \u0438 \u0432 \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 \u0438\u0445 \u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e. \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>;<\/code> (\u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u0431\u0435\u0437), \u043c\u044b \u0443\u0434\u0430\u043b\u0438\u043c (<code>rm<\/code>) \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b, \u0442.\u043a. \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d.<\/p>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 (\u0432 \u044d\u0442\u043e\u043c \u0438 \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445) \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">[SimpleClass::SimpleFunc] [SimpleTemplateFunc]: 11 [ComplexTemplateFunc]: 11 [SimpleTemplateFunc]: 22 [ComplexTemplateFunc]: 22 [SimpleClass::SimpleFunc] [TemplateClass::EasyFunc]<\/code><\/pre>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 <code>.cpp<\/code> \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b <code>.o<\/code> \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435.<\/p>\n<pre><code class=\"bash\">g++ -c *.cpp &amp;&amp; for f in *.o; do echo -e \"\\n--- $f ---\"; nm \"$f\" | grep -E 'SimpleClass|TemplateClass' | c++filt; done; rm *.o<\/code><\/pre>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 GCC, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c <code>-c<\/code>, \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e <code>.cpp<\/code> \u0432 \u043f\u0430\u043f\u043a\u0435.<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0446\u0438\u043a\u043b\u0430 <code>for<\/code> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <code>*.o<\/code> \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0440\u044f\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p><code>echo -e \"\\n--- $f ---\"<\/code> \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430. \u0424\u043b\u0430\u0433 <code>-e<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c escape-\u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>\\n<\/code> \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <code>nm<\/code>. \u041e\u043d\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <code>\"$f\"<\/code> .<\/p>\n<p>\u041f\u0430\u0439\u043f-\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>|<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u0438\u0437 <code>nm<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0435 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043d\u0435 \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <code>SimpleClass<\/code> \u0438 <code>TemplateClass<\/code>.<\/p>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 <code>grep<\/code> (Global Regular Expression Print) \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 \u0432\u044b\u0432\u043e\u0434, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 <code>nm<\/code>, \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u043b\u044e\u0431\u043e\u0435 \u0438\u0437 \u0438\u043c\u0435\u043d \u044d\u0442\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<p>\u0424\u043b\u0430\u0433 <code>-E<\/code> \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>|<\/code>(OR) \u0431\u0435\u0437 \u0440\u0430\u0437\u0434\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0439 \u0447\u0435\u0440\u0442\u043e\u0447\u043a\u0438 (<code>\\<\/code>) \u043f\u0435\u0440\u0435\u0434 \u043d\u0438\u043c.<\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <code>c++filt<\/code>. \u041e\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u0442 <strong>\u0434\u0435\u043c\u0430\u043d\u0433\u043b\u0438\u043d\u0433<\/strong>, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0435\u0439 \u0438\u043c\u0435\u043d\u0430 \u0432 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442. \u0422\u0430\u043a, \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 <code><em>ZN13TemplateClassIiE19ComplexTemplateFuncIiEEvRKT<\/em><\/code>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0447\u0442\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c (<code>done<\/code>), \u043c\u044b \u0443\u0434\u0430\u043b\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0447\u0435\u0440\u0435\u0437 <code>rm *.o<\/code>.<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">--- Alpha.o ---                  U SimpleClass::SimpleFunc() 0000000000000000 W void SimpleClass::SimpleTemplateFunc(int const&amp;) 0000000000000000 W void TemplateClass::ComplexTemplateFunc(int const&amp;)  --- Beta.o --- 0000000000000000 W void SimpleClass::SimpleTemplateFunc(int const&amp;) 0000000000000000 W void TemplateClass::ComplexTemplateFunc(int const&amp;)  --- Gamma.o ---                  U SimpleClass::SimpleFunc() 0000000000000000 W TemplateClass::EasyFunc()  --- TemplateUnit.o --- 0000000000000000 T SimpleClass::SimpleFunc()  --- main.o --- <\/code><\/pre>\n<ol>\n<li>\n<p>\u041e\u0441\u043e\u0431\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <code>SimpleClass::SimpleFunc()<\/code> &#8212; \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0447\u0438\u0445, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>TemplateUnit.cpp<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u0435\u0442\u043a\u0430 <code>T<\/code>(text) \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u0441 \u0441\u0438\u043b\u044c\u043d\u044b\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0430 \u0432\u0435\u0441\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b (\u043d\u0430 \u0442\u043e \u043e\u043d \u0438 \u0441\u0438\u043b\u044c\u043d\u044b\u0439).<\/p>\n<p>\u041c\u0435\u0442\u043a\u0430 <code>U<\/code>(undefined) \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043d\u043e \u0435\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0433\u0434\u0435-\u0442\u043e \u0432\u043e\u0432\u043d\u0435.<\/p>\n<p>\u0422\u0430\u043a, \u0444\u0430\u0439\u043b\u044b <code>Alpha.o<\/code> \u0438 <code>Gamma.o<\/code> \u0437\u043d\u0430\u044e\u0442 \u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438 <code>SimpleClass::SimpleFunc()<\/code>, \u043d\u043e \u043d\u0435 \u043e \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0438. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u044d\u0442\u0438 <code>.cpp<\/code> \u0444\u0430\u0439\u043b\u044b \u0438\u043c\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0445\u0435\u0434\u0435\u0440\u0435.<\/p>\n<p>\u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c, \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043b\u0438\u043d\u043a\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f undefined-\u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0438\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442, \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0414\u043b\u0438\u043d\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0443\u043b\u0435\u0439 \u0440\u044f\u0434\u043e\u043c \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c \u0435\u0449\u0451 \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d. \u041c\u044b \u0432\u0435\u0434\u044c \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u043f\u043e \u0441\u0443\u0442\u0438, \u043f\u043e\u043b\u0443\u0444\u0430\u0431\u0440\u0438\u043a\u0430\u0442\u0430\u043c\u0438.<\/p>\n<ol start=\"2\">\n<li>\n<p>\u041c\u0435\u0442\u043a\u0430 <code>W<\/code>(weak) \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <strong>\u0441\u043b\u0430\u0431\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/strong> \u0441\u0438\u043c\u0432\u043e\u043b\u0430.<\/p>\n<\/li>\n<\/ol>\n<p>&#171;\u0421\u043b\u0430\u0431\u043e\u0441\u0442\u044c&#187; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u0438\u043d\u043a\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0447\u043d\u0435\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432\u043e\u0435\u0434\u0438\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c. \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u043d\u043a\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u0442 \u0435\u0433\u043e \u0437\u0430 \u043e\u0431\u0440\u0430\u0437\u0435\u0446, \u0430 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0433\u043e &#8212; \u0432\u043e\u0437\u044c\u043c\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u0430\u0431\u044b\u0439, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e, \u0438\u0437 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u0430\u0431\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438.<\/p>\n<p>\u0412\u0441\u0435 \u0441\u043b\u0430\u0431\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 &#8212; \u044d\u0442\u043e <strong>\u043d\u0435\u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438<\/strong>, \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043b\u0430\u0441\u0441\u044b, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041d\u0435\u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0430\u0446\u0438\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 &#8212; \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u043e\u0435 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 <code>.cpp<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 <code>TemplateUnit.hpp<\/code>, \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 <code>Alpha.o<\/code>, <code>Beta.o<\/code>, <code>Gamma.o<\/code> &#8212; \u043f\u0440\u044f\u043c\u0430\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430.<\/p>\n<blockquote>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u044e\u043d\u0438\u0442\u0430\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u043b\u0438\u0448\u043d\u044e\u044e \u0440\u0430\u0431\u043e\u0442\u0443!<br \/>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u043f\u0440\u043e\u0438\u0437\u0432\u0451\u043b \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434.<br \/>\u041b\u0438\u043d\u043a\u0435\u0440 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442 \u0432\u0441\u0435 \u043f\u043b\u043e\u0434\u044b \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0443\u0434\u0430, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<\/blockquote>\n<p>\u0412 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u0432\u0440\u0435\u043c\u044f \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0437\u0440\u044f, \u043d\u0438\u0447\u0442\u043e\u0436\u043d\u044b.<\/p>\n<p>\u041d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0442\u043d\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0442\u044b\u0441\u044f\u0447\u0438, \u044e\u043d\u0438\u0442\u043e\u0432 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438 \u0441 \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0435 \u0437\u0430 \u043c\u0438\u043d\u0443\u0442\u0443, \u0430 \u0437\u0430 \u043f\u044f\u0442\u044c; \u043d\u0435 \u0437\u0430 \u043f\u044f\u0442\u044c, \u0430 \u0437\u0430 \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u0435\u0442, \u0431\u0438\u0437\u043d\u0435\u0441 \u0442\u0435\u0440\u044f\u0435\u0442 \u0434\u0435\u043d\u044c\u0433\u0438.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0443 \u0434\u043e\u043b\u0433\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0435\u0441\u0442\u044c \u0438 \u0438\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b. \u041d\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u0432\u043a\u043b\u0430\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c.<\/p>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 2: \u0418\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u044b \u0432 \u0445\u0435\u0434\u0435\u0440\u0435<\/h2>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u0435\u043d \u043f\u0435\u0440\u0432\u043e\u043c\u0443, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0440\u044f\u0442\u043d\u044b\u043c. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u0430 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u043e\u0432 \u0442\u0435\u0445, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u044b\u0448\u0430\u043b \u043e \u043d\u0438\u0445.<\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043e\u0431\u0449\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435, \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041d\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0438\u043d\u043b\u0430\u0439\u043d-\u0444\u0430\u0439\u043b\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u044e\u0431\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>TemplateUnit.inl<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0438\u043d\u043a\u043b\u0443\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 <code>TemplateUnit.hpp<\/code>. \u0422\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u0437 <code>.inl<\/code> \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e <code>.hpp<\/code>.<\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-461748","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/461748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=461748"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/461748\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=461748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=461748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=461748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}