当前位置:网站首页>std::is_ union,std::is_ class,std::integral_ constant
std::is_ union,std::is_ class,std::integral_ constant
2022-07-04 08:25:00 【pickled cabbage】
#include <iostream>
#include <string>
using namespace std;
struct A {
int num;
char type;
};
union B {
int num;
char type;
};
int main()
{
/*std::is_union Is a class template . Used to determine whether a type is a union type If it's a coalition ,value for true(1), Otherwise false(0), The judgment principle is related to some internal practices of the compiler */
cout << std::is_union<A>::value << endl;
cout << std::is_union<B>::value << endl;
/*cpp17*/
cout << std::is_union_v<A> << endl;
cout << std::is_union_v<B> << endl;
/*std::is_class Is a class template . Used to judge whether a type is a class type ( Union is not a class type ). */
cout << std::is_class<A>::value << endl;
cout << std::is_class<B>::value << endl;
/*cpp17*/
cout << std::is_class_v<A> << endl;
cout << std::is_class_v<B> << endl;
/*std::integral_constant, Is a class for packaging purposes * C++11 Class template introduced by the new standard . */
cout << std::integral_constant<int, 15>::value << endl;
cout << std::integral_constant<bool, true>::value << endl;
return 0;
}

边栏推荐
- 墨者学院-Webmin未经身份验证的远程代码执行
- deno debugger
- Snipaste convenient screenshot software, which can be copied on the screen
- 1、卡尔曼滤波-最佳的线性滤波器
- zabbix监控系统部署
- How to set multiple selecteditems on a list box- c#
- Sports [running 01] a programmer's half horse challenge: preparation before running + adjustment during running + recovery after running (experience sharing)
- Moher college phpMyAdmin background file contains analysis traceability
- 墨者学院-phpMyAdmin后台文件包含分析溯源
- Flask 常用组件
猜你喜欢

Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14

Newh3c - network address translation (NAT)

运动【跑步 01】一个程序员的半马挑战:跑前准备+跑中调整+跑后恢复(经验分享)

DM8 tablespace backup and recovery

Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future

弈柯莱生物冲刺科创板:年营收3.3亿 弘晖基金与淡马锡是股东
![[performance test] read JMeter](/img/c9/25a0df681c7ecb4a0a737259c882b3.png)
[performance test] read JMeter

Unity-Text上标平方表示形式+text判断文本是否为空

Redis sentinel mechanism

Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
随机推荐
SQL statement view SQL Server 2005 version number
zabbix監控系統自定義監控內容
Linear algebra 1.1
Laravel page load problem connection reset - PHP
Common components of flask
Learn nuxt js
Need help resetting PHP counters - PHP
NewH3C——ACL
Three paradigms of database design
21 examples of strategic goals to promote the rapid development of your company
Div hidden in IE 67 shows blank problem IE 8 is normal
1. Qt入门
团体程序设计天梯赛-练习集 L1-006 连续因子
How to reset IntelliSense in vs Code- How to reset intellisense in VS Code?
ES6 summary
小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
一文了解數據异常值檢測方法
Example analysis of C # read / write lock
[performance test] read JMeter
Oracle-存储过程与函数