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

教你如何建设网站wordpress模板编写

教你如何建设网站,wordpress模板编写,适合文章的wordpress,页面设计软件排行指定该类型对象可以默认构造 要求 以下情况下,类型 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/112392/

相关文章:

  • 企业营销型网站分析简洁个人wordpress模板
  • 旅游网站建设内容SEO与网站建设创意
  • 网站模板免费下载酒店管理系统顺德网站建设itshunde
  • 做药品的电商网站有哪些wordpress采集小说的主题
  • 做渔家乐推广的有哪些好网站wordpress 总数 函数
  • 佛山网站建设 奇锐科技哪个网站可以做相册
  • 网站站点不安全平陆县网站建设
  • wordpress 新变量河南企业网站排名优化价格
  • 太原怎样优化网站建设华为商城
  • 网站关键词排行查询萝岗手机网站建设
  • 网站开发公司官网门业网站模板
  • 手机网站建设的图片高端轻奢品牌
  • 化妆品 网站建设案例网站开发和小程序开发区别
  • 什么是高端网站建设装宽带一年大概需要多少钱
  • 怎么自己做整人网站wordpress注册邮箱收不到验证码
  • 农家乐网站 建设做网站ceo
  • 信息流广告投放流程东莞做网站优化天助网络
  • 深圳网站建设三把火科技有关学校网站建设策划书
  • 网站怎么防采集微信公众号怎样做淘客网站
  • 网站推广对接网页修改和编辑的软件有哪些
  • 聊城做网站信息包头哪里做网站
  • 分析北师大教育学原理网站建设网站制作案例价格
  • 北京工程建设信息网站余姚网站定制
  • 重庆巴南区网站开发去哪儿网站排名怎么做
  • 织梦调用网站名称WordPress网易云插卡
  • 宿迁网站搭建单位网站建设开发公司
  • 合肥中小企业网站制作在哪建网站
  • 网站制作费用低商标设计网站排行
  • 做网站用什么配置的vpsWordpress有用么
  • 主页值得是网站的主要内容所在页建筑公司名字大全20000个