Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > A question about typedef and classes and templates..

Reply
Thread Tools

A question about typedef and classes and templates..

 
 
JustSomeGuy
Guest
Posts: n/a
 
      09-20-2003
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.


 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      09-20-2003

"JustSomeGuy" <(E-Mail Removed)> wrote in message
news:bkgj9m$htc$(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CRTP-problem: How can the base class typedef a derived class' typedef? oor C++ 0 05-20-2008 12:39 PM
A question about big projects and classes within classes August0866 Ruby 1 03-17-2008 12:02 AM
typedef of template classes are always default constructed? aaragon C++ 12 11-08-2006 04:34 PM
need for typedef for instances of template classes puzzlecracker C++ 1 09-16-2005 05:29 AM
one more template question and some typedef Tony Johansson C++ 7 08-16-2005 07:55 PM



Advertisments