当前位置:网站首页>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;
}
边栏推荐
- Ecole bio rushes to the scientific innovation board: the annual revenue is 330million. Honghui fund and Temasek are shareholders
- ZABBIX monitoring system custom monitoring content
- SQL注入测试工具之Sqli-labs下载安装重置数据库报错解决办法之一(#0{main}thrown in D:\Software\phpstudy_pro\WWW\sqli-labs-……)
- Const string inside function - C #
- Fault analysis | MySQL: unique key constraint failure
- Preliminary study on temporal database incluxdb 2.2
- Chrome is set to pure black
- Comprendre la méthode de détection des valeurs aberrantes des données
- Moher College webmin unauthenticated remote code execution
- 2022 examination questions for safety managers of metal and nonmetal mines (underground mines) and examination papers for safety managers of metal and nonmetal mines (underground mines)
猜你喜欢
Ecole bio rushes to the scientific innovation board: the annual revenue is 330million. Honghui fund and Temasek are shareholders
SQL注入测试工具之Sqli-labs下载安装重置数据库报错解决办法之一(#0{main}thrown in D:\Software\phpstudy_pro\WWW\sqli-labs-……)
Openfeign service interface call
[go basics] 1 - go go
【性能测试】一文读懂Jmeter
ctfshow web255 web 256 web257
The second session of the question swiping and punching activity -- solving the switching problem with recursion as the background (I)
ZABBIX monitoring system custom monitoring content
1. Kalman filter - the best linear filter
AcWing 244. Enigmatic cow (tree array + binary search)
随机推荐
小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
团体程序设计天梯赛-练习集 L2-002 链表去重
Add log file to slim frame - PHP
Unity write word
Redis sentinel mechanism
Li Kou today's question -1200 Minimum absolute difference
Put a lantern on the website during the Lantern Festival
运动【跑步 01】一个程序员的半马挑战:跑前准备+跑中调整+跑后恢复(经验分享)
Introduction to neural network (Part 2)
21个战略性目标实例,推动你的公司快速发展
1. Kalman filter - the best linear filter
Use preg_ Match extracts the string into the array between: & | people PHP
Leetcode 146. LRU cache
Activiti常見操作數據錶關系
Fault analysis | MySQL: unique key constraint failure
SQL statement view SQL Server 2005 version number
How to set multiple selecteditems on a list box- c#
Oracle-存储过程与函数
zabbix监控系统自定义监控内容
Difference between static method and non static method (advantages / disadvantages)