Outlier对《C++ Templates》的笔记(3)

Outlier
Outlier (强迫症真闹心)

在读 C++ Templates

C++ Templates
  • 书名: C++ Templates
  • 作者: David Vandevoorde/Nicolai M. Josuttis
  • 副标题: The Complete Guide
  • 页数: 552
  • 出版社: Addison-Wesley Professional
  • 出版年: 2002-11-22
  • 2.1.2 Using the Template
    Thus, templates are compiled twice: Without instantiation, the template code itself is checked for correct syntax. Syntax errors are discovered, such as missing semicolons. At the time of instantia...
    2012-02-16 01:06:38 回应
  • 2.2 Argument Deduction
    Cast the arguments so that they both match: max(static_cast<double>(4),4.2) // OK Specify (or qualify) explicitly the type of T: max<double>(4,4.2) // OK
    2012-02-16 01:12:10 回应
  • 2.3 Template Parameters
    So far, we have looked at cases in which either all or none of the function template arguments were mentioned explicitly. Another approach is to specify only the first arguments explicitly and to a...
    2012-02-16 01:49:52 回应