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

网站公司是做什么的科技公司办公室设计

网站公司是做什么的,科技公司办公室设计,网站设计公司南京,设计师招聘网站有哪些指定该类型对象可以默认构造 要求 以下情况下,类型 T 满足可默认构造 (DefaultConstructible) : 给定 任意标识符 u, 下列表达式必须合法且拥有其指定的效果 表达式后条件T u对象 u 被默认初始化。T u{}对象 u 被值初始化或聚合初始化。…

指定该类型对象可以默认构造

要求

以下情况下,类型 T 满足可默认构造 (DefaultConstructible)

给定

  • 任意标识符 u

下列表达式必须合法且拥有其指定的效果

表达式后条件
T u对象 u 被默认初始化。
T u{}对象 u 被值初始化或聚合初始化。
T()

T{}

一个 T 类型的临时对象被值初始化或聚合初始化。

注解

对于非聚合类类型的对象,必须定义公开的默认构造函数(用户定义或隐式定义),以满足可默认构造 (DefaultConstructible)

非类对象类型的非 const 对象始终可默认构造 (DefaultConstructible)

const 的非类类型并非可默认构造 (DefaultConstructible)

const 的聚合类型,若其任何成员是非类类型对象,则并非可默认构造 (DefaultConstructible)

非对象类型(函数类型,引用类型,以及(可能 cv 限定的)void 类型)和 const 的非对象类型始终并非可默认构造 (DefaultConstructible)

调用示例

#include <iostream>
#include <type_traits>//编译器生成默认构造函数
struct A
{
};struct B
{std::string str; // 成员拥有非平凡默认构造函数
};struct C
{std::string str; // 成员拥有非平凡默认构造函数C() throw (int) //构造函数抛异常{}
};struct MyClass
{int ma;int mb;MyClass(): ma(101), mb(102){std::cout << this << "  " << __FUNCTION__ << " " << __LINE__<< " a:" << ma << " b:" << mb<< std::endl;}MyClass(int a, int b): ma(a), mb(b){std::cout << this << "  " << __FUNCTION__ << " " << __LINE__<< " a:" << ma << " b:" << mb<< std::endl;}MyClass(const MyClass &obj){this->ma = obj.ma;this->mb = obj.mb;std::cout << this << "  " << __FUNCTION__ << " " << __LINE__<< " a:" << ma << " b:" << mb<< std::endl;}MyClass(MyClass &&obj){this->ma = obj.ma;this->mb = obj.mb;std::cout << this << "  " << __FUNCTION__ << " " << __LINE__<< " a:" << ma << " b:" << mb<< std::endl;}
};int main()
{std::cout << std::boolalpha;std::cout << "std::is_default_constructible<int>::value: "<< std::is_default_constructible<int>::value << std::endl;std::cout << "std::is_trivially_default_constructible<int>::value: "<< std::is_trivially_default_constructible<int>::value << std::endl;std::cout << "std::is_nothrow_default_constructible<int>::value: "<< std::is_nothrow_default_constructible<int>::value << std::endl;std::cout << std::endl;std::cout << "std::is_default_constructible<A>::value: "<< std::is_default_constructible<A>::value << std::endl;std::cout << "std::is_trivially_default_constructible<A>::value: "<< std::is_trivially_default_constructible<A>::value << std::endl;std::cout << "std::is_nothrow_default_constructible<A>::value: "<< std::is_nothrow_default_constructible<A>::value << std::endl;std::cout << std::endl;std::cout << "std::is_default_constructible<B>::value: "<< std::is_default_constructible<B>::value << std::endl;std::cout << "std::is_trivially_default_constructible<B>::value: "<< std::is_trivially_default_constructible<B>::value << std::endl;std::cout << "std::is_nothrow_default_constructible<B>::value: "<< std::is_nothrow_default_constructible<B>::value << std::endl;std::cout << std::endl;std::cout << "std::is_default_constructible<C>::value: "<< std::is_default_constructible<C>::value << std::endl;std::cout << "std::is_trivially_default_constructible<C>::value: "<< std::is_trivially_default_constructible<C>::value << std::endl;std::cout << "std::is_nothrow_default_constructible<C>::value: "<< std::is_nothrow_default_constructible<C>::value << std::endl;std::cout << std::endl;//T u 对象 u 被默认初始化。MyClass myClass1;//T u{} 对象 u 被值初始化或聚合初始化。MyClass myClass2{201, 202};//T() T{}一个 T 类型的临时对象被值初始化或聚合初始化。MyClass(803, 801);MyClass{303, 301};return 0;
}

输出

std::is_default_constructible<int>::value: true
std::is_trivially_default_constructible<int>::value: true
std::is_nothrow_default_constructible<int>::value: truestd::is_default_constructible<A>::value: true
std::is_trivially_default_constructible<A>::value: true
std::is_nothrow_default_constructible<A>::value: truestd::is_default_constructible<B>::value: true
std::is_trivially_default_constructible<B>::value: false
std::is_nothrow_default_constructible<B>::value: truestd::is_default_constructible<C>::value: true
std::is_trivially_default_constructible<C>::value: false
std::is_nothrow_default_constructible<C>::value: false0x61fe78  MyClass 28 a:101 b:102
0x61fe70  MyClass 35 a:201 b:202
0x61fe80  MyClass 35 a:803 b:801
0x61fe88  MyClass 35 a:303 b:301

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

相关文章:

  • 外贸网站模版下载百度app下载
  • 电脑上建设银行网站打不开佛山搭建建网站哪家好
  • 怎么在百度上能搜到自己的网站中富国建设有限公司网站
  • 网站开发常用工具网站优化建设宁夏
  • 北京网站被处罚网站建设的优势是什么
  • 网站做好了怎么和域名家里电脑做网站服务器
  • 做石材外贸用什么网站外贸公司网站开发
  • word做网站框架青岛房产网最新楼盘价格
  • 网站手机版排名seo网站上的视频上传怎么做
  • 同一人可以做几个网站的负责人wordpress中文版下载
  • 一流高职院校建设网站电脑网站怎么创建到桌面上
  • 电商网站建设新闻武冈做网站
  • 做直播网站宽带怎么建立手机网站
  • 网站建设包括两个方面不属于网络推广方法
  • 高校网站建设 安全教育wordpress 文章分开
  • 公司网站作用四平网站建设联系方式
  • 现实有有哪里学做网站的网站购物车怎么做
  • 前端开发好学吗南京网站排名优化费用
  • 深圳求做网站图书馆网页设计素材
  • 网站建设问题调查如何修改网站源文件
  • 石家庄网站优化招聘昆明建设公司网站
  • 零食公司建立网站的原因广西seo公司
  • wordpress没有远程发布网站优化的论文
  • 揭阳网站制作计划最常用的专业网页设计工具
  • 做亚马逊产品测评的网站网上商城建站工作室
  • c2c网站价格logo设计理念简短范文
  • 智能logo设计网站张店网站制作哪家好
  • 常州网站制作企业wordpress 为静态
  • 建网站的公司七牛云wordpress加速
  • 平台网站开发价格河南省建设工程信息网查询