- 浏览: 399013 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (309)
- xaml C# wpf (0)
- scala java inner clas (1)
- Tools UML Eclipse UML2 (1)
- Timer .NET Framework (1)
- perl (6)
- python function paramter (1)
- Python Docstring (1)
- Python how to compare types (1)
- Python (8)
- java (5)
- C# (76)
- C# WPF (0)
- p4 (0)
- WPF (46)
- .net (6)
- xaml (1)
- javascript (40)
- windows (10)
- scala (4)
- winform (1)
- c++ (48)
- tools (12)
- cmd (1)
- os (0)
- CI (0)
- shell (0)
- C (2)
- haskell (49)
- functional (1)
- tool (1)
- gnu (1)
- linux (1)
- kaskell (0)
- svn (0)
- wcf (3)
- android (1)
最新评论
In the book - the C++ Primer 3rd edition, Stanley Lippman has introduced something about the compilatio model . He introduced two models.
- inclusion compilation model
- separation compilation model
with inclusion compilation model, the definition of the function template is included in the header file, while every source file that instantiates the function template is required to include the header file.
for space 's reason, I will not introduce the inclusion model in details.
He also introduced the separation model .
the quintessence/gist/marrow/essence/heart of the separation model is in the header file there is only the function template's declaration, and definition of the function template can goes into a separate source file. Client to the template function can include the header file and the the separate source file will have an export keyword to qualify the function's definition.
it is suppose to be like this;
// model2.h
template <typename Type> Type min2(Type t1, Type t2);
// model2.C
export template <typename Type> Type min2(Type t1, Type t2) { return t1 < t2 ? t1 : t2; }
and if you wan to use the template function , say in user.C , do this
#include "model2.h" int main2(int argc, char* argv[]) { int i, j; double dobj = min2(i, j); return 0; }
!!!BUT!!!!
However, the prolem is that the compiler that I tried, inlcuding the vc++ 11 or the gnu c++ does not support the export keyword, so I think it is not supported to have separation compilation model .
发表评论
-
不安装Visual Studio,只用Windows SDK搭建VC环境
2013-12-31 21:52 15338首先你需要下载的是 Microsoft Windows S ... -
rpath - runtime search path
2013-04-03 11:36 1008RPath is a very interesting to ... -
C++ - autogenerated copy constructor and assignment operator gotchas
2013-01-24 13:32 769It has been changed that the s ... -
c++ - rethrow a exception gotchas
2012-12-23 10:57 955As in my prevoius example in j ... -
c++ -typeid operator
2012-10-15 22:30 1057typeid is the one of the meager ... -
c++ - dynamic_cast revisit
2012-10-14 21:21 769There are several built-in type ... -
c++ - virtual inheritance example 1
2012-10-14 15:25 818we have discussed the virtual i ... -
c++ - virtual inheritance
2012-10-12 08:58 975As we have discussed in the pos ... -
c++ type of inheritance
2012-09-28 08:58 751There are 3 types of inheritanc ... -
c++ - vritually virtual new
2012-09-27 23:59 959Let's see what if we want to cl ... -
c++ - virtual destructor
2012-09-27 22:01 974As we all know that virtual des ... -
c++ - vritual function and default arguments
2012-09-27 08:56 993As we all know that we virtual ... -
c++ - template specialization and partial specialization
2012-09-26 22:38 1327in this post, we are going to e ... -
c++ - member template in class template
2012-09-26 08:19 936class member template can be us ... -
c++ template class and the pattern to use its friends
2012-09-25 23:47 985template class may defined thei ... -
c++ - Friend declaration in class Template
2012-09-25 08:47 1209There are three kinds of friend ... -
c++ - class template default parameters
2012-09-25 08:18 850the template has parameter, it ... -
c++ - operator new and delete and an example of linked list stores by new/delete
2012-09-24 07:53 587The operator new and delete ope ... -
c++ - delete(void *, size_t) or delete(void *)
2012-09-24 07:18 1165In my previous dicuss, we have ... -
c++ - placement operator new() and the operator delete()
2012-09-23 15:22 869A class member operator new() c ...
相关推荐
《新概念模拟电路》系列书籍是由著名放大器领域的专家所著,旨在深入浅出地讲解模拟电路的基础理论和实际应用。资源出自全球知名的半导体公司ADI(Analog Devices Inc.),这意味着书中涵盖的内容不仅有深厚的理论...
2. **QGIS-Compilation-Guide**: 编译指南详细介绍了如何从源代码编译QGIS,这对于开发者来说是必不可少的。这里可能包含构建环境的设置、依赖库的安装、编译选项的选择等。通过这个指南,你可以了解软件工程中的...
Computer brand, model, and the brands and model numbers of any additional hardware. d. Operating system and version number. (The version number can be determined by typing VER at the DOS prompt.)...
《新概念模拟电路》系列是ADI公司发布的一套专业教程,涵盖了广泛的模拟电路知识,旨在为电路设计者和学习者提供深入的理解与实践指导。这一系列共有五册,分别是《Analog Circuit I》、《Analog Circuit II》、...
Computer brand, model, and the brands and model numbers of any additional hardware. d. Operating system and version number. (The version number can be determined by typing VER at the DOS prompt.)...
compilation model, and be able to use a C++ development environment on Linux, Windows, or Mac OS. This book does not cover general C++ concepts as a rule, but some useful C++ books and articles, ...
The compiled_partitions sub-folder contains previous compilation results for each partition. As long as this folder is preserved, incremental compilation results from earlier compiles can be re-used. ...
linux软件编译,安装。_Linux-Software-compilation
- **Function Comments:** Describe what the function does, its parameters, and any side effects. - **Variable Comments:** Explain the purpose of important variables. - **Implementation Comments:** ...
The C++ Preprocessor define Statement Conditional Compilation include Files Parameterized Macros Advanced Features Summary Programming Exercises Answers to Chapter Questions 11. Bit Operations Bit ...
标题《Art-Exploring-the-New-Android-KitKat-Runtime》中的知识点涵盖了Android KitKat操作系统版本中引入的新运行时环境(Runtime Environment),特别是ART(Android Runtime)的探索和分析。Android KitKat是...
* Added the possibility to specify an include directory for the code completion cache to be created at Dev-C++ first startup * Improved code completion cache * WebUpdate will now backup downloaded ...
标题“univ-lr__Compilation__TEA”和描述“univ-lr__编译__TEA”都指向了一个关于大学(univ-lr)的编程项目,其中涉及了编译(Compilation)和TEA(可能是指Tiny Encryption Algorithm,一种简单的加密算法)。...
[INFO] --- takari-lifecycle-plugin:1.10.2:compile (default-compile) @ maven-incremental-compilation --- [INFO] Performing incremental build [INFO] Compiling 2 sources to /home/mariuszs/git/maven-...
Fixed a compilation problem with the pre-defined Resource Descriptor field names where an "object does not exist" error could be incorrectly generated if the parent ResourceTemplate pathname places ...
do the actual compilation itself it relegates it to ISCmplr.dll. If the ISCmplr project is changed, you normally don t need to recompile Compil32 since it s essentially a text editor, and is not ...
gch - gentoo-sources compilation helper 版本 0.20 概要: gch.sh [--help|-h] [--version|-v] [--kernel|-k ] [--initramfs|-i] [--yestoall|-y] 描述 If you're tired of manually (re)compiling your gentoo-...
Work with various types of strings and look at the various aspects of compilation Explore functions and callable objects with a focus on modern features Leverage the standard library and work with ...
Also added the parameter LengthPos in the function PointOnLine (see the updated tutorial-project CurveDemo). These functions allow defining a point on a curve by the distance from the original ...