zoukankan      html  css  js  c++  java
  • 8.1.2 Template instantiation (Accelerated C++)

    The C++ standard says nothing about how implementations should manage template i nstantiation, so every implementation handles instantiation in its own particular way. While we cannot say exactly how your compiler will handle instantiation, there are two important points to keep in mind: The first is that for C++ implementations that follow the traditional edit-compile-link model, instantiation often happens not at compile time, but at link time. It is not until the templates are instantiated that the implementation can verify that the template code can be used with the types that were specified. Hence, it is possible to get what seem like compile-time errors at link time.

    The second point matters if you write your own templates: Most current implementations require that in order to instantiate a template, the definition of the template, not just the declaration, has to be accessible to the implementation. Generally, this requirement implies access to the source files that define the template, as well as the header file. How the implementation locates the source file differs from one implementation to another. Many implementations expect the header file for the template to include the source file, either directly or via a #include. The most certain way to know what your implementation expects is to check its documentation.

  • 相关阅读:
    数组里面为对象根据某一属性排序
    理由<a>标签跳转到对应锚点
    jquery对复选框选中
    Fullcalendar
    es6学习
    vue 关于树杈图问题
    input 复选框样式修改
    GAMES101 作业2
    一份自己iOS 面试题,拿到15K35K,分享出来
    Cesium 一款面向三维地球和地图的,世界级的JavaScript开源产品
  • 原文地址:https://www.cnblogs.com/anit/p/3902404.html
Copyright © 2011-2022 走看看