forked from EnigmaVSSUT/CompetitiveCoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathis_standard template.cpp
More file actions
42 lines (34 loc) · 999 Bytes
/
is_standard template.cpp
File metadata and controls
42 lines (34 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// C++ program to illustrate
// std::is_standard_layout template
#include <iostream>
#include <type_traits>
using namespace std;
// Class with local variable
class gfg {
int variab;
};
// Structure with local variable
struct sam {
int variab;
private:
int variab_priv;
};
// Empty union
union raj {
};
// Driver code
int main()
{
cout << boolalpha;
cout << "Is gfg class a standard layout: "
<< is_standard_layout<gfg>::value << '\n';
cout << "Is structure sam a standard layout: "
<< is_standard_layout<sam>::value << '\n';
cout << "Is union raj a standard layout: "
<< is_standard_layout<raj>::value << '\n';
cout << "Is datatype char a standard layout: "
<< is_standard_layout<char>::value << '\n';
cout << "Is integer array 'int a[10]' a standard layout: "
<< is_standard_layout<int[10]>::value << '\n';
return 0;
}