当前位置:网站首页>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;
}
边栏推荐
- Unity write word
- Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future
- Oracle stored procedures and functions
- [untitled] 2022 polymerization process analysis and polymerization process simulation examination
- Devops Practice Guide - reading notes (long text alarm)
- Three paradigms of database design
- ZABBIX monitoring system custom monitoring content
- OpenFeign 服务接口调用
- Comprendre la méthode de détection des valeurs aberrantes des données
- 1、卡尔曼滤波-最佳的线性滤波器
猜你喜欢
小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
ZABBIX monitoring system custom monitoring content
Do you know about autorl in intensive learning? A summary of articles written by more than ten scholars including Oxford University and Google
DM8 uses different databases to archive and recover after multiple failures
根据数字显示中文汉字
1、卡尔曼滤波-最佳的线性滤波器
Flask 常用组件
Heap concept in JVM
墨者学院-PHPMailer远程命令执行漏洞溯源
NPM run build error
随机推荐
Li Kou today's question -1200 Minimum absolute difference
Example analysis of C # read / write lock
Common components of flask
snipaste 方便的截图软件,可以复制在屏幕上
How to set multiple selecteditems on a list box- c#
弈柯莱生物冲刺科创板:年营收3.3亿 弘晖基金与淡马锡是股东
小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
PHP session variable passed from form - PHP
OpenFeign 服务接口调用
[test de performance] lire jmeter
Chrome is set to pure black
The right way to capture assertion failures in NUnit - C #
没有Kubernetes怎么玩Dapr?
Oracle-存储过程与函数
A method for detecting outliers of data
Unity write word
Do you know about autorl in intensive learning? A summary of articles written by more than ten scholars including Oxford University and Google
谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
DM8 database recovery based on point in time
【Go基础】1 - Go Go Go