当前位置:网站首页>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;
}

边栏推荐
- How to reset IntelliSense in vs Code- How to reset intellisense in VS Code?
- C # implements a queue in which everything can be sorted
- AcWing 244. Enigmatic cow (tree array + binary search)
- Heap concept in JVM
- PHP session variable passed from form - PHP
- [performance test] read JMeter
- Difference between static method and non static method (advantages / disadvantages)
- Chrome is set to pure black
- Introduction to neural network (Part 2)
- 2022 electrician (intermediate) examination question bank and electrician (intermediate) examination questions and analysis
猜你喜欢

Take you to master the formatter of visual studio code

Guanghetong's high-performance 4g/5g wireless module solution comprehensively promotes an efficient and low-carbon smart grid

Openfeign service interface call

【Go基础】2 - Go基本语句

Wechat has new functions, and the test is started again

What sparks can applet container technology collide with IOT

zabbix监控系统自定义监控内容

Mouse over to change the transparency of web page image
![[go basics] 1 - go go](/img/e2/d973b9fc9749e1c4755ce7d0ec11a1.png)
[go basics] 1 - go go

小程序容器技术与物联网 IoT 可以碰撞出什么样的火花
随机推荐
SSRF vulnerability exploitation - attack redis
OpenFeign 服务接口调用
Redis sentinel mechanism
R language ggplot2 visualization: ggplot2 visualization grouping box diagram, place the legend and title of the visualization image on the top left of the image and align them to the left, in which th
deno debugger
Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future
Laravel page load problem connection reset - PHP
What determines vacuum permittivity and vacuum permeability? Why do these two physical quantities exist?
snipaste 方便的截图软件,可以复制在屏幕上
Leetcode 23. Merge K ascending linked lists
Conversion of yolov5 XML dataset to VOC dataset
Go h*ck yourself:online reconnaissance (online reconnaissance)
Cannot click button when method is running - C #
ZABBIX monitoring system deployment
2022 gas examination registration and free gas examination questions
Display Chinese characters according to numbers
Fault analysis | MySQL: unique key constraint failure
ctfshow web255 web 256 web257
Redis 哨兵机制
The second session of the question swiping and punching activity -- solving the switching problem with recursion as the background (I)