From f1baa20b86c7eaeb121681fb718be9fa583b3edf Mon Sep 17 00:00:00 2001 From: pnykEX <47064637+pnykEX@users.noreply.github.com> Date: Tue, 22 Oct 2019 22:28:15 +0530 Subject: [PATCH] Template specialisation --- is_standard template.cpp | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 is_standard template.cpp diff --git a/is_standard template.cpp b/is_standard template.cpp new file mode 100644 index 0000000..383d2b8 --- /dev/null +++ b/is_standard template.cpp @@ -0,0 +1,42 @@ +// C++ program to illustrate +// std::is_standard_layout template + +#include +#include +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::value << '\n'; + cout << "Is structure sam a standard layout: " + << is_standard_layout::value << '\n'; + cout << "Is union raj a standard layout: " + << is_standard_layout::value << '\n'; + cout << "Is datatype char a standard layout: " + << is_standard_layout::value << '\n'; + cout << "Is integer array 'int a[10]' a standard layout: " + << is_standard_layout::value << '\n'; + + return 0; +} +