SUNphi  1.0
StaticMemberWithInitializator.hpp File Reference

Provides a static member with an initalizator. More...

Go to the source code of this file.

Macros

#define PROVIDE_STATIC_MEMBER_WITH_INITIALIZATOR(T, NAME, VALUE, DESCRIPTION)
 

Detailed Description

Provides a static member with an initalizator.

Definition in file StaticMemberWithInitializator.hpp.

Macro Definition Documentation

#define PROVIDE_STATIC_MEMBER_WITH_INITIALIZATOR (   T,
  NAME,
  VALUE,
  DESCRIPTION 
)
Value:
\
static int& NAME() \
{ \ \
static int _ ## NAME \
=VALUE; \
\
return _ ## NAME; \
}

Provides a static member with an initalizator

A method NAME() is provided, which gives access to the internal data. This is implemented to avoid out-of-line initialization, following the advice of https://stackoverflow.com/a/31608148

Definition at line 15 of file StaticMemberWithInitializator.hpp.