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

网站域名注册哪个好营销网页

网站域名注册哪个好,营销网页,坪山新区城市建设局网站,深圳网站建设深圳网类型特性 类型特性定义一个编译时基于模板的结构&#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.15wanjia.com/news/31602.html

相关文章:

  • 网站设计收费模式免费网站搭建
  • 网站开发的评论界面怎么写济南头条新闻热点
  • 深圳市做网站公司武汉企业seo推广
  • 网站开发相关技术企业培训课程分类
  • 矿山建设网站惠州关键词排名提升
  • 网站建设品牌公司哪家好怎样优化标题关键词
  • 贵阳市小程序网站开发公司外链seo
  • 免费企业网站系统源码下载seo查询平台
  • 福州外贸网站建设怎么做一个网站的步骤
  • 罗玉凤做网站seo外链建设的方法
  • 建站前期准备广州网站推广联盟
  • 商务网站开发文档谷歌关键词热度查询
  • 蚌埠市做家教网站无锡seo公司找哪家好
  • wordpress怎装模板seo推广优化方案
  • 宁波网站建设公司费用价格知乎推广合作
  • 公司做网站好吗百度百度一下你就知道主页
  • 做的网站如何全屏外链官网
  • 网站开发学院网站外链发布平台
  • 做网站哪种域名好记正规营销培训
  • 网站建设公司怎么做业务优化百度seo
  • 哈尔滨网站建设费用霸屏seo服务
  • 深圳建设银行官方网站上海高端seo公司
  • ps设计网站步骤关键词排名优化易下拉技术
  • 企业网站维护工作内容如何在百度上发广告
  • discuz做地方门户网站北京网络营销招聘
  • 鹤壁做网站重庆seo网站系统
  • 网站做301跳转百度竞价推广效果好吗
  • 烟台 网站建设互联网广告价格
  • 做网站原创要多少钱安卓优化大师下载安装到手机
  • html5网站首页代码做引流推广的平台600