Extern templates
来源:互联网 发布:windows 10 dpi 编辑:程序博客网 时间:2024/06/08 17:39
A template specialization can be explicitly declared as a way to suppress multiple instantiations. For example:
#include "MyVector.h"
extern template class MyVector<int>; // Suppresses implicit instantiation below --
// MyVector<int> will be explicitly instantiated elsewhere
void foo(MyVector<int>& v)
{
// use the vector in here
}
The “elsewhere” might look something like this:
#include "MyVector.h"
template class MyVector<int>; // Make MyVector available to clients (e.g., of the shared library
This is basically a way of avoiding significant redundant work by the compiler and linker.
0 0
- Extern templates
- Templates
- templates
- Templates
- Templates
- Templates
- templates
- templates
- templates
- extern
- extern
- extern
- extern
- extern
- extern
- extern
- extern
- extern
- JVM实用参数(六) 吞吐量收集器
- eclipse新建workspace如何保留之前的相关设置
- Class.getResourceAsStream(path)与Thread.currentThread().getContextClassLoader().getResourceAsStream
- iOS 使用AFNetworking实现多张图片上传
- Android_实现省市区(县)三级联动效果
- Extern templates
- js需要把时间戳转为为普通格式
- 利用分类实现功能
- TQEditor logo网页在线编辑器 TQEditor
- poj 1273 hdu 1532 网络流最大流 Dinic算法
- bzoj1503郁闷的出纳员 Splay
- SysLetvPlayerLib无法播放本地视频
- mysql对自增id重新从1排序的两种方法
- spring boot 整合Freemarker