15,895,011 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by debil123 (Top 7 by date)
debil123
17-Apr-13 10:49am
View
But both copy constructors are the same. why not to implement single generic one?
I mean- that's the original question is all about.
debil123
17-Apr-13 10:08am
View
In that way you have to implement copy constructor instead of the assignment operator for each iterator type.
I thought it is obvious from my original post.
debil123
14-Apr-13 9:42am
View
It does do something that the base class can't do. The base class can't check the someCheck(). That's the whole point. All this needed for the begin(), end(), erase() and other functions which the iterator itself doesn't know how to do.
debil123
14-Apr-13 2:45am
View
it doesn't compile. assignment operator, although its trivial should be added to support the assignment needed by my begin() function.
debil123
13-Apr-13 17:51pm
View
It is not the answer I was looking for. Did you read the "p.s." thing? It states that the example is just to clarify my question- how to template the inherited class.
debil123
13-Apr-13 17:49pm
View
this:
template< class Item > class directedListTypeIter : public typename std::list<item>::iterator
does define which type of iterator it is. it is forward iterator.
but- as I said, the solution you posted in the beginning can solve my issue. but I am not interested in solving this particular issue of creating forward, or reverse iterator. I am interested in finding how to template inheritance.
I mean- why this:
directedListTypeIter& operator=(realIter &constructorIter){
((realIter*)this)->operator=(constructorIter);
return *this;
}
is ambiguity?
debil123
11-Apr-13 12:03pm
View
Thanku for your answer. It may be a solution for the example issue.
But, it is not applicable in my case.
1. I can't use myContext instead of std::list.
2. when compiling templated code, I understand that the compiler duplicates the code. It means that both types of iterators can't share a single list. Because it defined twice. But, maybe we don't need that definition at all.
Anyway, it is not the answer I was looking for.
Did you read the "p.s." thing? It states that the example is just to clarify my question- how to template the inherited class.
Show More