conditional typedef in templates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • n.torrey.pines@gmail.com

    #1

    conditional typedef in templates

    What I'd like to do:

    template<typena me T>
    struct s {
    typedef typename T::foo foo; // define if and only if T::foo
    exists
    };

    Can I do something like this with templates (AFAIK not), and if not,
    are there other patterns you think I should be looking at?

    TIA

Working...