On Fri, Nov 21, 2003 at 08:51:36AM +0000, Angus Leeming wrote:
> In turn, buffer.h has this:
> #include "ParagraphList_fwd.h"
> class Buffer {
> public:
> class inset_iterator {
> private:
> ParagraphList::iterator pit;
> ParagraphList::iterator pend;
> };
> };
>
> So, my question becomes: do you need to know 'paragraph' to
> instantiate std::list<paragraph>::iterator? I guess the answer to
> that is 'yes' (or the compiler would not be complaining). That being
> the case, then I also guess that the CORRECT place to #include
> "paragraph" (and I hate to say this) is buffer.h itself.
>
> Thoughts?
I seem to remember a discussion that resulted in "a declaration of a
class (without definition) is sufficient to _declare_ (but not to
instantiate) a template based on that class" (either here or in
comp.lang.c++[.moderated]/de.comp.lang.iso-c++)
But this is really walking the edge and probably difficult to get right
for the compiler implementors.
> Why do non-g++3.4 compilers seem quite happy with this though?
Maybe this debug modus Lars was speaking of instantiates the template.
Andre'