A question about typedef and classes and templates..

Discussion in 'C++' started by JustSomeGuy, Sep 20, 2003.

  1. JustSomeGuy

    JustSomeGuy Guest

    template <class Type>
    class myclass
    {
    public:
    typedef struct
    {
    Type a;
    Type b;
    } myclassType;

    // The rest of the class
    };


    So my question is I have a template vector class and I want to
    declare a vector<myclassType> with Type being double.
    How do I declare the vector properly?

    TIA
    B.
    JustSomeGuy, Sep 20, 2003
    #1
    1. Advertising

  2. JustSomeGuy

    Mike Wahler Guest

    "JustSomeGuy" <> wrote in message
    news:bkgj9m$htc$...
    > template <class Type>
    > class myclass
    > {
    > public:
    > typedef struct
    > {
    > Type a;
    > Type b;
    > } myclassType;
    >
    > // The rest of the class
    > };
    >
    >
    > So my question is I have a template vector class and I want to
    > declare a vector<myclassType> with Type being double.
    > How do I declare the vector properly?


    vector<myclass<double>::myclassType> vec;



    -Mike
    Mike Wahler, Sep 20, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JKop
    Replies:
    3
    Views:
    449
  2. Generic Usenet Account
    Replies:
    3
    Views:
    797
    Generic Usenet Account
    Jul 14, 2005
  3. Ben Pope
    Replies:
    4
    Views:
    358
    Neelesh Bodas
    Dec 6, 2005
  4. recover
    Replies:
    2
    Views:
    782
    recover
    Jul 25, 2006
  5. oor
    Replies:
    0
    Views:
    1,329
Loading...

Share This Page