码迷,mamicode.com
首页 >  
搜索关键字:typename    ( 798个结果
BST完全实现
1 #include <iostream> 2 #include<string> 3 #include<binaryNode.hpp> 4 using namespace std; 5 template<typename T> 6 class BST { 7 public: 8 BST() { sz ...
分类:其他好文   时间:2021-05-03 12:22:02    阅读次数:0
std::move的理解
std::move 的定义 template <typename T> // typename表明type是一个类型 typename remove_reference<T>::type&& move(T&& t) { return static_cast<typename remove_refer ...
分类:其他好文   时间:2021-04-08 13:54:15    阅读次数:0
C++Template学习
template<typename T> void funcTmp(T a, T b) { cout << "this is yiban" << endl; } template<> void funcTmp(const char* a, const char* b) { cout << "this ...
分类:编程语言   时间:2021-03-31 12:19:34    阅读次数:0
2d平面向量计算
PlaneVector.hpp #ifndef PlaneVector_h__ #define PlaneVector_h__ template<typename coordinate_type> struct PlaneVector { coordinate_type x; coordinate_ ...
分类:其他好文   时间:2021-03-04 13:30:28    阅读次数:0
std::map和std::mulitmap的简单实现
std::map的实现 template <class Pair> struct Select1st_ { const typename Pair::first_type& operator()(const Pair& x) const { return x.first; } }; template ...
分类:其他好文   时间:2021-03-01 13:20:12    阅读次数:0
指纹锁(STL--set)
set 其作用是去重,排序。 set常用操作: #include<set> //声明一个set容器 set<typename> s;//定义,typename为数据类型,假设定义了一个容器s //常用操作: s.insert(x);//将x插入set容器中,并自动排序,去重 s.find(value ...
分类:其他好文   时间:2021-02-16 12:32:19    阅读次数:0
mapbox中 变长参数的宏函数
// // variadic_template.h// template <typename T>class Enum {public: using Type = T; static const char * toString(T); static T toEnum(const std::strin ...
分类:其他好文   时间:2021-02-16 12:24:36    阅读次数:0
二叉查找树
1 #include <iostream> 2 3 using namespace std; 4 5 template <typename K, typename V> 6 class BST 7 { 8 private: 9 struct node // 类内定义类、结构体 10 { 11 K k ...
分类:其他好文   时间:2021-02-16 12:09:37    阅读次数:0
C++ 标准模板库(STL):vector
1. vector 变长数组,长度根据需要而自动变化的数组。 当普通数组会超过内存的情况,这种情况使用vector会让问题的解决便捷许多。 vector可以用来以邻接表的方式存储图 1.1 vector的定义 定义一维变长数组 vector<typename> name; 这个的typename可以 ...
分类:编程语言   时间:2021-01-25 11:02:50    阅读次数:0
C++new与定位new
1.new运算符和new[]运算符 new运算符会根据所给类型动态分配内存(在堆中),然后返回首地址 A.动态分配基本类型和基本类型的数组 //基本类型 //仅分配空间,不初始化 typeName * pointer = new typeName; //例: int * pint = new int ...
分类:编程语言   时间:2021-01-16 12:06:12    阅读次数:0
798条   上一页 1 2 3 4 ... 80 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!