Queries size of the object or type
Used when actual size of the object must be known
sizeof( type ) // 1 |
sizeof( expression ) // 2 |
Both versions return an object of type std::size_t
.
1) returns size in bytes of any instance of the given type
.
2) returns size in bytes of any instance of the type that would be returned by the given expression
if evaluated.
type
- typename of a type to be examined
expression
- an expression to be examined
size of any instance of the given type or the type of the given expression.