SUNphi  1.0
Macros.hpp File Reference

Header file to define some usefule macro. More...

Go to the source code of this file.

Macros

#define _CONCAT2_IMPL(X, Y)   X ## Y
 
#define _CONCAT2_WRAP(X, Y)   _CONCAT2_IMPL(X,Y)
 
#define CONCAT2(X, Y)   _CONCAT2_WRAP(X,Y)
 
#define CONCAT3(X, Y, Z)   CONCAT2(CONCAT2(X,Y),Z)
 Concatenate three tokens.
 
#define NAME2(X, Y)   CONCAT3(X,_,Y)
 Merges two tokens using a _.
 
#define NAME3(X, Y, Z)   NAME2(X,NAME2(Y,Z))
 Merges three tokens with two _.
 
#define NAME4(X, Y, W, Z)   NAME2(X,NAME3(Y,W,Z))
 Merges four tokens with three _.
 
#define PROVIDE_ASSIGNMENT_OPERATOR(PROVIDER)   PROVIDER(=) \
 Provides assignment through a simple macro.
 
#define PROVIDE_ALL_BINARY_OPERATORS(PROVIDER)
 Provides all binary operators through a simple macro. More...
 

Detailed Description

Header file to define some usefule macro.

Definition in file Macros.hpp.

Macro Definition Documentation

#define _CONCAT2_IMPL (   X,
 
)    X ## Y

Concatenate two tokens

Internal implementation

Definition at line 11 of file Macros.hpp.

#define _CONCAT2_WRAP (   X,
 
)    _CONCAT2_IMPL(X,Y)

Concatenate two tokens

Wrapper to beat CPP

Definition at line 17 of file Macros.hpp.

#define CONCAT2 (   X,
 
)    _CONCAT2_WRAP(X,Y)

Concatenate two tokens

User accessible implementation

Definition at line 23 of file Macros.hpp.

#define PROVIDE_ALL_BINARY_OPERATORS (   PROVIDER)
Value:
PROVIDER(+=); \
PROVIDER(-=); \
PROVIDER(*=); \
PROVIDER(/=); \
PROVIDER(+); \
PROVIDER(-); \
PROVIDER(*); \
PROVIDER(/); \
PROVIDER(==); \
PROVIDER(!=); \
PROVIDER(<); \
PROVIDER(<=); \
PROVIDER(>); \
PROVIDER(>=)

Provides all binary operators through a simple macro.

Definition at line 49 of file Macros.hpp.