在看STL的源码,发现is_pointer的模板调用,写了一个测试代码如下:
#include
#include
using namespace::std;
namespace iotek{
template
struct integral_constant
{
static constexpr _Tp value = _...
分类:
编程语言 时间:
2014-09-30 17:38:29
阅读次数:
523
用C++模板书写一段序列数组的全部排列
/**
* 书本:【windows程序设计】
* 功能:输出全部的排列情况
* 文件:全排列.cpp
* 时间:2014年9月29日21:52:55
* 作者:cutter_point
*/
#include
using namespace std;
//交换两个元素的函数
template
inline void Swap(Type &a...
分类:
其他好文 时间:
2014-09-30 00:33:47
阅读次数:
344
private static VelocityContext vc;
static {
vc = new VelocityContext();
}
public static void generateFile(String tempatePath, String destPath, Map<String, Object> attributes) {
Template te...
分类:
其他好文 时间:
2014-09-29 15:29:11
阅读次数:
147
链表节点ListNode.h 1 #include "stdafx.h" 2 #include 3 using namespace std; 4 template class LinkStack; 5 template 6 // 链表节点 7 class ListNode{ 8 privat...
分类:
其他好文 时间:
2014-09-29 14:19:41
阅读次数:
212
单链表类模板节点头ListNode.h 1 #include "stdafx.h" 2 #include 3 using namespace std ; 4 template class SingleList; 5 template 6 class ListNode{ 7 private: 8 .....
分类:
其他好文 时间:
2014-09-29 13:49:20
阅读次数:
243
双链表链表节点ListNode.h 1 #include "stdafx.h" 2 #include 3 using namespace std; 4 5 template class DoublyList; 6 template 7 // 节点信息 8 class ListNode{ 9 ...
分类:
其他好文 时间:
2014-09-29 13:16:30
阅读次数:
272
增加了逆置迭代器的实现 以及swap功能 完整代码如下: #ifndef VECTOR_H_
#define VECTOR_H_ #include #include #include template class Vector
{
public: typedef T *iterator; typed...
分类:
其他好文 时间:
2014-09-29 04:28:56
阅读次数:
282
1 #include 2 #include 3 #include 4 using namespace std; 5 6 template 7 T max(T a, T b) 8 { 9 return a > b ? a : b;10 }11 12 13 14 int main(i...
分类:
编程语言 时间:
2014-09-28 23:43:45
阅读次数:
390
代码如下: template void reverse(It begin, It end)
{ while(begin != end) { --end; if(begin != end) std::swap(*begin++, *end); }
} 注意几点: 1.不能一开始...
分类:
其他好文 时间:
2014-09-28 21:37:45
阅读次数:
232
using System;public static class GreaterTest{ public static of( left, right) {) .MakeGenericType(type).IsAssignableFrom(intf) || ...
分类:
其他好文 时间:
2014-09-28 20:31:35
阅读次数:
264