Archive for June, 2020

std::is_standard_layout<>

Written by on June 21, 2020 in C++, Programming with 0 Comments
std::is_standard_layout<>

In our last post, we learnt about the type trait std::is_trivial<T>. Today, let us go through another type trait that is quite similar. The expression¬†is_standard_layout<T>::value returns true if the layout of objects of type T is compiler independent, and hence is of standard format. Else, it returns false. This is important if we create objects […]

Continue Reading

std::is_trivial<>

Written by on June 6, 2020 in C++, Programming with 0 Comments
std::is_trivial<>

Today let us try to understand the type trait std::is_trivial<T>. This trait checks if the given type is a trivial type. For a precise definition of what trivial means, please visit the official page. As usual, we will go through three cases: – Primitive types – Classes without inheritance – Classes involving inheritance Case-1: Primitive […]

Continue Reading

Top