Boost logo

Boost Users :

Subject: [Boost-users] choosing from a list of types based on a runtime value
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-03-06 11:29:57


say I have a

template <typename Tag> // Tag should be 1 in 10 types
struct S {
...
};

in a function f(int Tag) // Tag is computed here at runtime
{
 switch(Tag)
 {
   case 0: // use S<Tag0>
  ...
   case 9: // use S<Tag9>
 }
}

Is fusion the lib to help with problems like this,
so I don't need to write the full switch case for all types,

regards,


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