Topic: Please implement more rules about memory layout of


Author: unituniverse.1@gmail.com
Date: Mon, 6 May 2013 08:03:43 -0700 (PDT)
Raw View
------=_Part_7_32062077.1367852623279
Content-Type: text/plain; charset=ISO-8859-1

First of all, I think it won't hurt almost every existing compilers.
Actually it won't asking for any change of each one of them:
Say,
*1.
- If each of all the base classes of a class has only one base class, and
each of all these classes neither contains any Virtual function nor
Virtually inherited from the other class, The most inheritance will share
the same address of each bases.
*2.
- If a class has no virtual functions, the first defined data member of
will share the same address of the class.
*3(Optional).
- If a classe inherited from only one class, the two class will share the
same address.

I think the rule about the Standard-Layout is not much help for C++ itself
because if we need to extend a class by inheriting rather than defind a
data member to use its original protected member functions. If we need to
apply the memory layout then it's a realy big lose if the data member
definition is the only option: The access controls won't be easy, even the
function can be mapped it is also slow for both compiling and
running(canceled inlines) even with inline keyword.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



------=_Part_7_32062077.1367852623279
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>First of all, I think it won't hurt almost every existing compilers. A=
ctually it won't asking for any change of each one of them:</div><div>Say,<=
/div><div>*1.</div><div>- If each of all the base classes of a class has on=
ly one base class, and each of all these classes neither contains any Virtu=
al function nor Virtually inherited from the other class, The most inherita=
nce will share the same address of each bases.</div><div>*2.</div><div>- If=
 a class has no virtual functions, the first defined data member of will sh=
are the same address of the class.</div><div>*3(Optional).</div><div>- If a=
 classe inherited from only one class, the two class will share the same ad=
dress.</div><div><br></div><div>I think the rule about the Standard-Layout =
is not much help for C++ itself because if we need to extend a class by inh=
eriting rather than defind a data member to use its original protected memb=
er functions. If we need to apply the memory layout then it's a realy big l=
ose if the data member definition is the only option: The access controls w=
on't be easy, even the function can be mapped it is also slow for both comp=
iling and running(canceled inlines) even with inline keyword.</div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_7_32062077.1367852623279--

.