Boost logo

Boost Users :

Subject: [Boost-users] Hierarchical enumeration?
From: Archie14 (admin_at_[hidden])
Date: 2009-09-20 19:34:31


Does boost (or any other lib in C++) have facility to support smth that
resembles hierarchical enumeration? I would like to have something like the
following:

enum Hierarchy
{
   Store::Clothing = 1
   Store::Electronics,
   Building::Residential,
   Building::Commercial
}

...
Hierarchy h = Hierarchy::Building::Commercial;
...
if (h == Hierarchy::Store)
{
   if (h == Hierarchy::Store::Clothing)
      std::cout<<"clothing";
}
...


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