码迷,mamicode.com
首页 >  
搜索关键字:variadic template    ( 8894个结果
C++ 11标准STL中Traits的is_pointer的实现
在看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
品鉴Velocity之 -- 文件读与写
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
Vector的一种实现(二)
增加了逆置迭代器的实现 以及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
C++学习之路: 函数模板
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
C# Meta Programming - Let Your Code Generate Code - Introduction of The Text Template Transformation Toolkit(T4)
using System;public static class GreaterTest{ public static of( left, right) {) .MakeGenericType(type).IsAssignableFrom(intf) || ...
分类:其他好文   时间:2014-09-28 20:31:35    阅读次数:264
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!