当前位置: 首页 > news >正文

视频生成链接网站汕尾百度seo公司

视频生成链接网站,汕尾百度seo公司,软件设计网站,wordpress内部服务器错误类型特性 类型特性定义一个编译时基于模板的结构&#xff0c;以查询或修改类型的属性。 试图特化定义于 <type_traits> 头文件的模板导致未定义行为&#xff0c;除了 std::common_type 可依照其所描述特化。 定义于<type_traits>头文件的模板可以用不完整类型实例…

类型特性


类型特性定义一个编译时基于模板的结构,以查询或修改类型的属性。

试图特化定义于 <type_traits> 头文件的模板导致未定义行为,除了 std::common_type 可依照其所描述特化。

定义于<type_traits>头文件的模板可以用不完整类型实例化,除非另外有指定,尽管通常禁止以不完整类型实例化标准库模板。
 

类型修改

类型修改模板通过应用修改到模板参数,创建新类型定义。结果类型可以通过成员 typedef type 访问。

从给定类型移除 const 或/与 volatile 限定符

std::remove_cv, 
std::remove_const, 
std::remove_volatile

template< class T >
struct remove_cv;

(1)(C++11 起)

template< class T >
struct remove_const;

(2)(C++11 起)

template< class T >
struct remove_volatile;

(3)(C++11 起)

提供与 T 相同的成员 typedef type ,除了其最顶层 cv 限定符被移除。

1) 移除最顶层 const 、最顶层 volatile 或两者,若存在。

2) 移除最顶层 const

3) 移除最顶层 volatile

成员类型

名称定义
type无 cv 限定符的 T

辅助类型

template< class T >
using remove_cv_t       = typename remove_cv<T>::type;

(C++14 起)

template< class T >
using remove_const_t    = typename remove_const<T>::type;

(C++14 起)

template< class T >
using remove_volatile_t = typename remove_volatile<T>::type;

(C++14 起)

 可能的实现

template< class T >
struct remove_cv {typedef typename std::remove_volatile<typename std::remove_const<T>::type>::type type;
};template< class T > struct remove_const          { typedef T type; };
template< class T > struct remove_const<const T> { typedef T type; };template< class T > struct remove_volatile             { typedef T type; };
template< class T > struct remove_volatile<volatile T> { typedef T type; };

调用示例

#include <iostream>
#include <type_traits>int main()
{typedef std::remove_cv<const int>::type CVtype1;typedef std::remove_cv<volatile int>::type CVtype2;typedef std::remove_cv<const volatile int>::type CVtype3;typedef std::remove_cv<const volatile int*>::type CVtype4;typedef std::remove_cv<int * const volatile>::type CVtype5;std::cout << "std::is_same<int, std::remove_cv<const int>::type>::value:    "<< (std::is_same<int, CVtype1>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int, std::remove_cv<volatile int>::type>::value: "<< (std::is_same<int, CVtype2>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int, std::remove_cv<const volatile int>::type>::value:"<< (std::is_same<int, CVtype3>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<const volatile int*, std::remove_cv<const volatile int*>::type>::value:  "<< (std::is_same<const volatile int*, CVtype4>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int*, std::remove_cv<int * const volatile>::type>::value: "<< (std::is_same<int*, CVtype5>::value ? "passed" : "failed") << std::endl;std::cout << std::endl;typedef std::remove_const<const int>::type Ctype1;typedef std::remove_const<volatile int>::type Ctype2;typedef std::remove_const<const volatile int>::type Ctype3;typedef std::remove_const<const volatile int*>::type Ctype4;typedef std::remove_const<int * const volatile>::type Ctype5;std::cout << "std::is_same<int, std::remove_const<const int>::type>::value:    "<< (std::is_same<int, Ctype1>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int, std::remove_const<volatile int>::type>::value: "<< (std::is_same<int, Ctype2>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int, std::remove_const<const volatile int>::type>::value:"<< (std::is_same<int, Ctype3>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<const volatile int*, std::remove_const<const volatile int*>::type>::value:  "<< (std::is_same<const volatile int*, Ctype4>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int*, std::remove_const<int * const volatile>::type>::value: "<< (std::is_same<int*, Ctype5>::value ? "passed" : "failed") << std::endl;std::cout << std::endl;typedef std::remove_volatile<const int>::type Vtype1;typedef std::remove_volatile<volatile int>::type Vtype2;typedef std::remove_volatile<const volatile int>::type Vtype3;typedef std::remove_volatile<const volatile int*>::type Vtype4;typedef std::remove_volatile<int * const volatile>::type Vtype5;std::cout << "std::is_same<int, std::remove_volatile<const int>::type>::value:    "<< (std::is_same<int, Vtype1>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int, std::remove_volatile<volatile int>::type>::value: "<< (std::is_same<int, Vtype2>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int, std::remove_volatile<const volatile int>::type>::value:"<< (std::is_same<int, Vtype3>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<const volatile int*, std::remove_volatile<const volatile int*>::type>::value:  "<< (std::is_same<const volatile int*, Vtype4>::value ? "passed" : "failed") << std::endl;std::cout << "std::is_same<int*, std::remove_volatile<int * const volatile>::type>::value: "<< (std::is_same<int*, Vtype5>::value ? "passed" : "failed") << std::endl;std::cout << std::endl;return 0;
}

输出

std::is_same<int, std::remove_cv<const int>::type>::value:    passed
std::is_same<int, std::remove_cv<volatile int>::type>::value: passed
std::is_same<int, std::remove_cv<const volatile int>::type>::value:passed
std::is_same<const volatile int*, std::remove_cv<const volatile int*>::type>::value:  passed
std::is_same<int*, std::remove_cv<int * const volatile>::type>::value: passedstd::is_same<int, std::remove_const<const int>::type>::value:    passed
std::is_same<int, std::remove_const<volatile int>::type>::value: failed
std::is_same<int, std::remove_const<const volatile int>::type>::value:failed
std::is_same<const volatile int*, std::remove_const<const volatile int*>::type>::value:  passed
std::is_same<int*, std::remove_const<int * const volatile>::type>::value: failedstd::is_same<int, std::remove_volatile<const int>::type>::value:    failed
std::is_same<int, std::remove_volatile<volatile int>::type>::value: passed
std::is_same<int, std::remove_volatile<const volatile int>::type>::value:failed
std::is_same<const volatile int*, std::remove_volatile<const volatile int*>::type>::value:  passed
std::is_same<int*, std::remove_volatile<int * const volatile>::type>::value: failed

http://www.yayakq.cn/news/817028/

相关文章:

  • 企业网站托管公司怎么搭建钓鱼网站
  • 贵阳网站网站建设互联网广告公司
  • 企业网站网址举例淘宝店铺网站策划书
  • 柳州网站建设招聘外加工网
  • 刚建设的网站多久能在百度查到wordpress .htaccess 固定链接
  • 网页制作价格南京网站流量优化
  • 网站上传用什么软件做视频扬州北京网站建设
  • 塘厦东莞网站建设frame全屏摄影创意中英文wordpress模板主题
  • nat123做视频网站用excel可以做网站
  • 企业网站的推广形式有哪些有没有做网站的
  • 网站模板分类高端网站设计v芯hyhyk1推好
  • 做互联网小程序 和网站有没有前景专业营销网站开发
  • h5响应式网站技术前端做企业网站
  • 阿里云esc 可以做几个网站中国建设银行网站公积金查询
  • 哪有做婚介网站的网站建站公司有必要做吗
  • 界面好看的网站深圳建设工程交易服务网网址
  • 用windows搭建手机网站专门卖化妆品网站建设
  • 二维码网页制作免费网站制作自己开加工厂怎么找订单
  • 北京做网站推广多少钱wordpress先生
  • 进行企业网站建设规划网站建设都需要那些材料
  • 河南省汝州文明建设门户网站seo代理计费系统
  • 大望路做网站的公司精美的网站
  • 上海建设局网站小程序开发外包费用
  • 如何让订阅号菜单做微网站延庆精神文明建设的门户网站
  • 外贸网站后台温州哪里有做网站的
  • wordpress开启子目录多站点模式建湖人才网
  • 可视化拖拽网站建设软件jsp做手机网站
  • 建设信用卡网站是什么互诺 网站好吗
  • app 门户网站网页制作与网站建设课程设计
  • 木材 技术支持 东莞网站建设wordpress添加媒体库