libDAI
Macros
enum.h File Reference

Defines the DAI_ENUM macro, which can be used to define an enum with additional functionality. More...

#include <cstring>
#include <iostream>
#include <dai/exceptions.h>

Go to the source code of this file.

Macros

#define DAI_ENUM(x, val0, ...)
 Extends the C++ enum type by supporting input/output streaming and conversion to and from const char* and size_t. More...
 

Detailed Description

Defines the DAI_ENUM macro, which can be used to define an enum with additional functionality.

Macro Definition Documentation

#define DAI_ENUM (   x,
  val0,
  ... 
)

Extends the C++ enum type by supporting input/output streaming and conversion to and from const char* and size_t.

For more details see the source code.

Example:
1 DAI_ENUM(colors,RED,GREEN,BLUE)
defines a class colors encapsulating an
1 enum {RED, GREEN, BLUE};
which offers additional functionality over the plain enum keyword.