条款47模板局部特化
不能对函数模板进行局部特化,所能做的即使重载它们。
但可以对类模板进行局部特化。
template class Heap; //主模板
template classHeap{…}; //局部特化
局部特化的语法类似完全特化,但是他的模板参数列表是非空的。当使用任何(未经修饰的)指针类型来实例化一个Heap时,这个局部特化版将优先于主模板而被采用。进一步而言...
分类:
编程语言 时间:
2014-06-07 01:46:57
阅读次数:
248
1、错误描述
五月 28, 2014 10:32:40 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Expression student.course is undefined on line 16, column 25 in course.ftl."
Expres...
分类:
其他好文 时间:
2014-06-05 09:14:11
阅读次数:
185
如果尿布臭了,就换掉它。
1.Duplicated Code 重复代码
Extract MethodPull Up MethodForm Template Method --》 Template Method 模式Substitute Algorithm --》 函数算法替代
2.Long Method 过长的函数
“间接层”所带来的全部利益--解释能力、共享能...
分类:
其他好文 时间:
2014-06-05 08:45:40
阅读次数:
291
1、错误描述
五月 28, 2014 9:56:48 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Expression student.course is undefined on line 15, column 24 in course.ftl."
Express...
分类:
其他好文 时间:
2014-06-05 07:35:59
阅读次数:
348
freemarker
1、错误描述
java.io.FileNotFoundException: Template user.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:580)
at freemarker.template.Configuration.getT...
分类:
其他好文 时间:
2014-06-05 03:05:45
阅读次数:
247
1、错误描述
五月 27, 2014 12:07:05 上午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Can't convert the date to string, because it is not known which parts of the date va...
分类:
其他好文 时间:
2014-06-04 22:00:07
阅读次数:
280
条款55模板的模板参数
见一下stack适配器采用默认Deque的例子
template>
class Stack{
public:
~stack();
void push();
private:
Conts_;
};
这里,Stack的用户现在必须提供一个模板实参,表示元素的类型,还可以提供一个表示容器的类型(默认为deque),并且容器必须能够容...
分类:
编程语言 时间:
2014-06-03 05:00:39
阅读次数:
305
1、错误描述
五月 30, 2014 11:52:04 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Can't convert the date to string, because it is not known which parts of the date va...
分类:
其他好文 时间:
2014-06-02 22:33:40
阅读次数:
332
1、错误描述
五月 30, 2014 11:33:57 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Expected hash. flag evaluated instead to freemarker.template.TemplateBooleanModel$2...
分类:
其他好文 时间:
2014-06-01 11:21:47
阅读次数:
401
#include
using namespace std;
//template
class Int
{
friend ostream& operator
public:
Int(int i):m_i(i)
{
}
Int& operator++()
{
++(this->m_i);
r...
分类:
其他好文 时间:
2014-06-01 09:00:22
阅读次数:
209