blaze::HasSize< T, Size > Struct Template Reference

Compile time size check.This class offers the possibility to test the size of a type at compile time. If the type T is exactly Size bytes large, the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType. More...

#include <HasSize.h>

Inherits Type< sizeof(T)==Size, TrueType, FalseType >.

Detailed Description

template<typename T, size_t Size>
struct blaze::HasSize< T, Size >

Compile time size check.

This class offers the possibility to test the size of a type at compile time. If the type T is exactly Size bytes large, the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.

blaze::HasSize<int,4>::value // Evaluates to 1 (on most architectures)
blaze::HasSize<float,4>::Type // Results in TrueType (on most architectures)
blaze::HasSize<const double,8> // Is derived from TrueType (on most architectures)
blaze::HasSize<const char,8>::Type // Results in FalseType
blaze::HasSize<unsigned char,4> // Is derived from FalseType

The documentation for this struct was generated from the following file: