![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++知识
xianqi21
这个作者很懒,什么都没留下…
展开
-
auto和decltype的区别
C++ auto和decltype关键字 C++11新标准引入了auto和declty这两个类型推断关键字,auto的推断是基本上针对赋值类型,而decltype则常常希望重表达式中推断出要定义变量的类型,但是不想用该表达式的值初始化变量。 auto num = 21;//num为int类型,初始值为21 decltype (num) tmp;//tmp为int类型 1. auto auto...原创 2020-02-11 22:35:44 · 485 阅读 · 0 评论 -
C++模板的全特化和偏特化
C++模板的全特化与偏特化全特化偏特化例子总结 全特化 全特化一般用于处理有特殊要求的类或者函数,此时依靠泛型模板无法处理这种情况。,因此全特化可以运用在类模板和函数模板当中。其模板参数列表为空。 template<> class A<int, char> {}; template<> void func(int arg) {} 偏特化 对部分参数进行指定初...原创 2019-12-31 12:08:23 · 349 阅读 · 0 评论 -
istringstream、ostringstream、stringstream 类介绍
istringstream、ostringstream、stringstream 类介绍 c++的输入输出主要分为以下3种 标准流输入输出(基于控制I/O) 头文件:#include <iostream> ostream:写到流中去 istream:从流中读取 iostream:对流进行读写 文件流输入输出(基于文件I/O) 头文件:#include <fs...原创 2019-11-24 22:19:39 · 220 阅读 · 0 评论 -
next_permutation、prev_permutation以及is_permutation使用
next_permutation、prev_permutation以及is_permutation使用next_permutationprev_permutationis_permutation next_permutation、prev_permutation以及is_permutation均为全排列相关的函数,调用时需要加入头文件#include <algorithm> next_...原创 2019-10-31 21:32:01 · 419 阅读 · 3 评论