/** * Created with IntelliJ IDEA. * User:
li_zhe * Date: 14/05/06 * Time: 12:34 * To change this template use File |
Settings | File Templates. */pack...
分类:
其他好文 时间:
2014-05-16 22:09:34
阅读次数:
431
模板模式(Template
Pattern),又叫模板方法模式,通过定义一个操作的算法骨架,而将一些步骤延迟到子类中,可以不改变一个算法的结构即可以重新定义概算法的某些特定步骤。应用场景概念解释类型:行为型模式
分类:
其他好文 时间:
2014-05-16 05:30:17
阅读次数:
240
为了效率,copy算法可谓无所不用其极,通过分析copy算法能够体会STL的精妙。
首先是三个对外接口:
template // 泛化版本
inline OutputIterator copy(InputIterator first, InputIterator last,
OutputIterator result)
{
...
分类:
其他好文 时间:
2014-05-15 05:50:02
阅读次数:
315
下面是标准库STL中allocator的实现
template
class allocator
: public _Allocator_base
{ // generic allocator for objects of class _Ty
public:
typedef allocator other;
typedef _Allocator_base _Mybase;
t...
分类:
其他好文 时间:
2014-05-15 05:05:57
阅读次数:
385
[QQ群: 189191838,对算法和C++感兴趣可以进来] 直接逼入正题。Standard
Template
Library简称STL。STL可分为容器(containers)、迭代器(iterators)、空间配置器(allocator)、配接器(adaptors)、算法(algorit...
分类:
其他好文 时间:
2014-05-14 03:55:43
阅读次数:
273
c++ 中的template和c#的什么有点相似?先看下定义方式:template T
myFunction(T param1,T param2...){ T result= param1; // do something return
result; ...
分类:
编程语言 时间:
2014-05-14 03:05:27
阅读次数:
332
hash_map和map的用法很相似,只是底层机制有所不同。
hash_map容器采用的底层机制是hash table代码:
template ,
class EqualKey = equal_to,
class Alloc = alloc>
class hash_map
{
private:
typedef hashtable, Key...
分类:
其他好文 时间:
2014-05-13 22:59:23
阅读次数:
256
按javaweb王者归来做strut2练习使用<struts:headtheme:"ajax">报错org.apache.jasper.JasperException:Template/template/ajax/head.ftlnotfound加入struts2-dojo-plugin-2.1.6包并在jsp里引入<%@taglibprefix="sx"uri="/struts-dojo-tags"%><sx:head/>这是..
分类:
Web程序 时间:
2014-05-13 13:00:55
阅读次数:
854
本段程序主要利用数据结构栈的先进后出特点,实现回溯求解迷宫路径问题。
#include
#include
using namespace std;
//坐标类
struct Point
{
int x;
int y;
};
//地图类
template
struct Map
{
int (*p)[A];
int row;//行数
int col;//列数
};
//start起始点, ...
分类:
其他好文 时间:
2014-05-13 05:25:02
阅读次数:
478
Flask默认使用的是Jinja2的模板引擎,下面将会介绍下Flask提供给模板的一些方法。#-*-coding:utf-8-*-
#导入一些函数
fromflaskimportFlask
fromflaskimportrender_template,g
#创建一个app
app=Flask(__name__)
#创建一个装饰器
@app.route("/")
@app.route("/index")
defindex..
分类:
其他好文 时间:
2014-05-11 19:25:12
阅读次数:
443