Wt::Enum< CHILD > Class Template Reference

typesafe enumaration like class More...

#include <enum.h>

Inherited by Wt::Audio::FadingType, Wt::Audio::MusicType, Wt::SDLEvent, and Wt::W.

List of all members.


class  Member
class  Var
class  VarBase

Detailed Description

template<typename CHILD>
class Wt::Enum< CHILD >

typesafe enumaration like class

Usage example class ColorEnum : public Enum<ColorEnum> { public: static const Member Red; static const Member Green; static const Member Purple; static const Member Black; };

Initialization ColorEnum::Member Red = 2; ColorEnum::Member Green; // implied 3 ColorEnum::Member Purple = 47; // forced 47 ColorEnum::Member Black; // implied 48

Now ColorEnum::Var some_color = Red; //ok; some_color = 3 //ok some_color = 9999 //failed at runtime: assertion && exception

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

Generated Fri Jul 28 19:22:38 2006.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.