Boost logo

Boost Users :

From: Oliver.Kowalke_at_[hidden]
Date: 2006-03-27 01:41:50


Hello,
is a technique available in boost in order to assign an int value to a
enum?

enum E
{
  e1 = 1,
  e2 = 2,
  e3 = 3
};

E e( static_cast< E >( 1) ); // should work

E e( static_cast< E >( 5) ); // should throw exception at runtime

Regards,
Oliver


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net