Qt源码中的Template模板用法.pptVIP

  • 23
  • 0
  • 约5.78千字
  • 约 17页
  • 2019-12-01 发布于湖北
  • 举报
* Qt源码中的C++ Template 用法 yoyo,2015 Review of C++ Template Syntax Qt Template MetaProgramming C++ Template usage in Qt 1 2 3 一般用法 Review of C++ Template Syntaxyntax // 一个简单的加法模板 templateclass T class Addition { public: T fun( T a, T b ) { return ( a + b ); } }; specialization Review of C++ Template Syntaxyntax template class Additionchar * { public: char * fun( char * a, char * b ) { ... strcat_s(... ); return a; } }; Partial specialization Review of C++ Template Syntaxyntax /* ** 特化为引用,指针类型 ** 偏特化,半特化,局部特化,部分特化 ** 在编码时

文档评论(0)

1亿VIP精品文档

相关文档