Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,929 of 33,346    |
|    Bobby to All    |
|    member function returns by-value    |
|    14 Mar 13 04:25:07    |
      From: bob@sharklasers.com              It is no surprise to me that adding a member of type X       leads to an "incomplete type" error.              But why then is it possible (both with g++ and VC) to       define a function returning a X? See code // <--              Okay, the 1st one is a structural issue (that leads to       an recursion).              Is there a predefined way how a compiler shall analyze a       class definition, like:       (1) first analyze all data members       (2) then (re-)analyze all member functions              The ARM says in §9.2:       "Before the end of the declaration of a class, its name       can be used only where its size need not be known."              But looking at the assembly code the compiler sure needs       to know how much space to reserve on the stack for aX.              Or is the ARM wrong in saying "inline functtions are not       type checked until after the complete class decl. has been seen".       Does this apply to ALL member functions, not just inlined?              #include |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca