|
// Control.h
// Author: Zeeshan Amjad
//
// Contains the control structure of meta program
//
#ifndef _CONTROL_H
#define _CONTROL_H
#include "functional.h"
template <int Start, int End, int Exp = 1,
template <int u, int v> class ExpOperator = Add,
template <int u, int v> class Operator = Add,
template<int u, int v> class BiFun = Value>
struct ForLoop
{
enum { value = Operator<BiFun<Start, End>::value,
ForLoop<ExpOperator<Start, Exp>::value, End, Exp, ExpOperator, Operator, BiFun>::value>::value };
};
template <int End, int Exp,
template <int u, int v> class ExpOperator,
template <int u, int v> class Operator,
template<int u, int v> class BiFun>
struct ForLoop<End, End, Exp, ExpOperator, Operator, BiFun>
{
enum { value = BiFun<End, End>::value };
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.