Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
list of template class objects
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
manu1001
New Member
Join Date:
Jul 2007
Posts:
14
#1
list of template class objects
Apr 19 '08, 03:40 AM
i have a template class definition.
Code:
template <class T> class ab { ... };
how do i declare a list of type ab using STL's list container.
Laharl
Recognized Expert
Contributor
Join Date:
Sep 2007
Posts:
849
#2
Apr 19 '08, 04:50 AM
You use list<ab<T> >. You have to leave the space between the >, otherwise the compiler misinterprets it as the >> operator...
Comment
Post
Cancel
manu1001
New Member
Join Date:
Jul 2007
Posts:
14
#3
Apr 19 '08, 09:30 AM
thanks, it works.
another problem, i'm not able to declare an iterator in the same way.
Code:
std::list<MyClass<T> >::iterator i;
gives an error: "expected ';' before i".
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment