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
   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,


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at