Blaze  3.6
blaze::IsMultipleOf< M, N > Struct Template Reference

Compile time check for a multiplicative relationship of two integral values.This value trait tests whether the first given integral value M is a multiple of the second integral value N (i.e. if $ M = x*N $, where x is any positive integer in the range $ [0..\infty) $). In case the value is a multiple of N, the value member enumeration is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType. More...

#include <IsMultipleOf.h>

Inherits blaze::IntegralConstant< T, N >.

Detailed Description

template<size_t M, size_t N>
struct blaze::IsMultipleOf< M, N >

Compile time check for a multiplicative relationship of two integral values.

This value trait tests whether the first given integral value M is a multiple of the second integral value N (i.e. if $ M = x*N $, where x is any positive integer in the range $ [0..\infty) $). In case the value is a multiple of N, the value member enumeration is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.

blaze::IsMultipleOf<8,2>::value // Evaluates to 1 (x*2 = 8 for x = 4)
blaze::IsMultipleOf<2,2>::value // Evaluates to 1 (x*2 = 2 for x = 1)
blaze::IsMultipleOf<0,2>::Type // Results in TrueType (x*2 = 0 for x = 0)
blaze::IsMultipleOf<0,0> // Is derived from TrueType (x*0 = 0 for any x)
blaze::IsMultipleOf<5,3>::value // Evaluates to 0 (5 is no integral multiple of 3)
blaze::IsMultipleOf<2,3>::Type // Results in TrueType (2 is no integral multiple of 3)
blaze::IsMultipleOf<2,0> // Is derived from TrueType (2 is no multiple of 0)

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