![]() |
|
#1
|
|||
|
|||
Template inside another templateHallo all!
I have done some Google research, but i have not found something on this: let us assume that, in NsDeque.h i have: CPP / C++ / C Code:
CPP / C++ / C Code:
the compiler (g++) points an error at CPP / C++ / C Code:
Is not nested call of templates supported? Thanks in advance Last edited by LuciWiz : 01-Sep-2008 at 07:59.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
||||
|
||||
Re: template inside another templateI didn't have the time to test it, perhaps you could provide us with the error message.
For sure the compiler will have problems with this line CPP / C++ / C Code:
The compiler will confuse the consecutive closing angular braces (">>") with the streaming operator. Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#3
|
|||
|
|||
Re: Template inside another templateQuote:
The question you need to ask yourself is what does nesting provide that can't also be more easily achieved through judicious use of namespace's. When posting questions such as this, please provide either minimal code which when compiled will generate the same error, or at least post the error observed. Given what you posted, it is anyone's guess as to what you are really doing. The art of getting good answers lies in the ability to adequately communicate the problem observed. Last edited by ocicat : 01-Sep-2008 at 11:08.
|
|
#4
|
|||
|
|||
Re: Template inside another templateAs LuciWiz said it is the gap that caused the error.
I thank you both of you. |
|
#5
|
|||
|
|||
Re: Template inside another templateYou have not did anything useful.
|
|
#6
|
|||
|
|||
Re: Template inside another templateQuote:
What do you mean by that? |
|
#7
|
||||
|
||||
Re: Template inside another templateQuote:
You're better off not to ask...there are a lot of wannabes around here and shrugging them off is a good skill to have. Mexican Bob |
|
#8
|
||||
|
||||
Re: Template inside another templateHi ocicat.
I am not sure I understand this statement: Quote:
I am not aware of the Standard disallowing nested template classes. Can you please clarify what you mean by this? Thanks, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
|
#9
|
|||
|
|||
Re: Template inside another templateQuote:
CPP / C++ / C Code:
Irregardless of my memory lapse nesting has never been a common practice, & I stand by my earlier comment that using namespaces to accomplish the same scope limitation is perhaps a preferable practice. |
|
#10
|
||||
|
||||
Re: Template inside another templateQuote:
I was 10 back then, sorry Quote:
I feel the same way. Nested classes are useful if you draw some value from using the PIMPL idiom, but I can't think of any other useful feature on the spot. Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Fatal error C1083: Cannot open include file | mia | C++ Forum | 5 | 14-May-2007 16:35 |
| Template Problem | Peter_APIIT | C++ Forum | 4 | 11-May-2007 03:17 |
| Multiple questions for C++ project | devster420 | C++ Forum | 1 | 20-Apr-2007 22:26 |
| Template usage - global functions | ankakusu | C++ Forum | 3 | 18-Dec-2006 16:18 |
| Combining Vectors and References | Frankg | C++ Forum | 7 | 14-Jan-2006 07:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The