Topic: Structure of Arrays


Author: Alexander Brook Perry <alex@alexgeek.co.uk>
Date: Wed, 15 Aug 2018 16:42:11 -0700 (PDT)
Raw View
------=_Part_142_1187296723.1534376531494
Content-Type: multipart/alternative;
 boundary="----=_Part_143_15949.1534376531495"

------=_Part_143_15949.1534376531495
Content-Type: text/plain; charset="UTF-8"

Hey,

Does anyone know if there are any existing proposals to standardise using
Structures of Arrays (SoA) over Arrays of Structures (AoS)?

I've seen a lot of advocacy for the SoA approach in gameplay and graphics
programming but it doesn't seem to fit in with the core language without
typing error prone boilerplate.

It would be great to define a POD structure like the following:

struct Health
{
  int Current;
  int Max;
}

But then be easily able to get a container like this automatically:

struct HealthSoA
{
  Container<int> Current;
  Container<int> Max;
}


The ideal syntax for getting this being something similar to:

struct HealthSoA : public SoA<Health, std::array> {}

But I'm not sure this is possible without reflection, I don't think any
template wizardry could create this but I would love to be proven wrong.

It would also be ideal to generate a reference of pointer based version of
the POD automatically too like this:

struct HealthByRef
{
  int& Current;
  int& Max;
}


Where each member reference the value stored in the SoA container. I'm not
saying that is a good but would allow flexibility / interop of with AoS
code.

Maybe this would be a nested type of the SoA e.g. HealthSoA::ReferenceType
or HealthSoA::PointerType.

E.g. in following we often want to use the same container type like a
std::vector

template<typename T>
struct VectorSoA : public SoA<T, std::vector>
{
  // match the members of std::vector<T> but store in SoA individual
containers
  SoA<T, std::vector>::ReferenceType operator[](size_t index) const { return /*
??? */ ; }

  void push_back(const T& value) { /* ??? */ }

  // etc.
}



Thoughts?

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/d46fccdb-9d56-47d1-8a32-33b077fcb120%40isocpp.org.

------=_Part_143_15949.1534376531495
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hey,<div><br></div><div>Does anyone know if there are any =
existing proposals to standardise using Structures of Arrays (SoA) over Arr=
ays of Structures (AoS)?=C2=A0</div><div><br></div><div>I&#39;ve seen a lot=
 of advocacy for the SoA approach in gameplay and graphics programming but =
it doesn&#39;t seem to fit in with the core language without typing error p=
rone boilerplate.</div><div><br></div><div>It would be great to define a PO=
D structure like the following:</div><div><br></div><div><div class=3D"pret=
typrint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(1=
87, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-wor=
d;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #6=
06;" class=3D"styled-by-prettify">Health</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br>=C2=A0 </span><span style=3D"color: #008;" class=3D"styl=
ed-by-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">=
Current</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 <=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #606;" class=3D"styled-by-prettify">Max</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">}</span></div></code></div><span style=3D"color: =
rgb(0, 0, 136);"><br></span></div><div>But then be easily able to get a con=
tainer like this automatically:</div><div><br></div><div class=3D"prettypri=
nt" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 1=
87, 187); border-style: solid; border-width: 1px; word-wrap: break-word;"><=
code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" cl=
ass=3D"styled-by-prettify">HealthSoA</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br>=C2=A0 </span><span style=3D"color: #606;" class=3D"styled-b=
y-prettify">Container</span><span style=3D"color: #080;" class=3D"styled-by=
-prettify">&lt;int&gt;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettif=
y">Current</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Contai=
ner</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&lt;int=
&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #606;" class=3D"styled-by-prettify">Max</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">}</span></div></code></div><div><br><=
/div><div><br></div><div>The ideal syntax for getting this being something =
similar to:=C2=A0</div><div><br></div><div class=3D"prettyprint" style=3D"b=
ackground-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); bord=
er-style: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"=
prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"style=
d-by-prettify">HealthSoA</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">:</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">public</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #606;" class=3D"styled-by-prettify">SoA</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: =
#606;" class=3D"styled-by-prettify">Health</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">array</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{}</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div><=
/code></div><div><br></div><div>But I&#39;m not sure this is possible witho=
ut reflection, I don&#39;t think any template wizardry could create this bu=
t I would love to be proven wrong.</div><div><br></div><div>It would also b=
e ideal to generate a reference of pointer based version of the POD automat=
ically too like this:</div><div><br></div><div class=3D"prettyprint" style=
=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187);=
 border-style: solid; border-width: 1px; word-wrap: break-word;"><code clas=
s=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;=
" class=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"st=
yled-by-prettify">HealthByRef</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><br>=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">int</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&a=
mp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #606;" class=3D"styled-by-prettify">Current</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" cl=
ass=3D"styled-by-prettify">Max</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">}</span></div></code></div><div><br></div><div><br></div><div>Where ea=
ch member reference the value stored in the SoA container. I&#39;m not sayi=
ng that is a good but would allow flexibility / interop of with AoS code.=
=C2=A0</div><div><br></div><div>Maybe this would be a nested type of the So=
A e.g. HealthSoA::ReferenceType or HealthSoA::PointerType.=C2=A0</div><div>=
<br></div><div>E.g. in following we often want to use the same container ty=
pe like a std::vector</div><div><div><br></div><div class=3D"prettyprint" s=
tyle=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 1=
87); border-style: solid; border-width: 1px; word-wrap: break-word;"><code =
class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #=
008;" class=3D"styled-by-prettify">template</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">typename</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> T</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">struct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">VectorSo=
A</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">public</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" cla=
ss=3D"styled-by-prettify">SoA</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify">T</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> std<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">vector</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"color: #80=
0;" class=3D"styled-by-prettify">// match the members of std::vector&lt;T&g=
t; but store in SoA individual containers</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"color: #606=
;" class=3D"styled-by-prettify">SoA</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">T</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify">vector</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;::</span><spa=
n style=3D"color: #606;" class=3D"styled-by-prettify">ReferenceType</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">operator</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">[](</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify">size_t index</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">const</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">return</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #800;" class=3D"styled-by-prettify">/* ??? */</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br>=C2=A0 <br>=C2=A0 </span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> push_back</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">const</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> T</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> va=
lue</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800=
;" class=3D"styled-by-prettify">/* ??? */</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br>=C2=A0 <br>=C2=A0 </span><span style=3D"color: #800;" cl=
ass=3D"styled-by-prettify">// etc.</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">}</span></div></code></div><div><br><br></div></div><div>=
<br></div><div>Thoughts?=C2=A0</div><div><br></div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/d46fccdb-9d56-47d1-8a32-33b077fcb120%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/d46fccdb-9d56-47d1-8a32-33b077fcb120=
%40isocpp.org</a>.<br />

------=_Part_143_15949.1534376531495--

------=_Part_142_1187296723.1534376531494--

.


Author: Barry Revzin <barry.revzin@gmail.com>
Date: Wed, 15 Aug 2018 17:37:17 -0700 (PDT)
Raw View
------=_Part_153_417607079.1534379837190
Content-Type: multipart/alternative;
 boundary="----=_Part_154_245575510.1534379837191"

------=_Part_154_245575510.1534379837191
Content-Type: text/plain; charset="UTF-8"



On Wednesday, August 15, 2018 at 6:42:11 PM UTC-5, Alexander Brook Perry
wrote:
>
> Hey,
>
> Does anyone know if there are any existing proposals to standardise using
> Structures of Arrays (SoA) over Arrays of Structures (AoS)?
>
> I've seen a lot of advocacy for the SoA approach in gameplay and graphics
> programming but it doesn't seem to fit in with the core language without
> typing error prone boilerplate.
>
> It would be great to define a POD structure like the following:
>
> struct Health
> {
>   int Current;
>   int Max;
> }
>
> But then be easily able to get a container like this automatically:
>
> struct HealthSoA
> {
>   Container<int> Current;
>   Container<int> Max;
> }
>
>
> The ideal syntax for getting this being something similar to:
>
> struct HealthSoA : public SoA<Health, std::array> {}
>
> But I'm not sure this is possible without reflection, I don't think any
> template wizardry could create this but I would love to be proven wrong.
>


The good news is that it's definitely possible *with* reflection, and
that's coming. Not for C++20, but could be for C++23. Any specific language
feature for this case would be known throw-away work - not sure it's worth
it for this?

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/1f2c9cae-07f8-4cd2-95ea-8ba0751673b0%40isocpp.org.

------=_Part_154_245575510.1534379837191
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, August 15, 2018 at 6:42:11 PM UTC-5,=
 Alexander Brook Perry wrote:<blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><=
div dir=3D"ltr">Hey,<div><br></div><div>Does anyone know if there are any e=
xisting proposals to standardise using Structures of Arrays (SoA) over Arra=
ys of Structures (AoS)?=C2=A0</div><div><br></div><div>I&#39;ve seen a lot =
of advocacy for the SoA approach in gameplay and graphics programming but i=
t doesn&#39;t seem to fit in with the core language without typing error pr=
one boilerplate.</div><div><br></div><div>It would be great to define a POD=
 structure like the following:</div><div><br></div><div><div style=3D"backg=
round-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:sol=
id;border-width:1px;word-wrap:break-word"><code><div><span style=3D"color:#=
008">struct</span><span style=3D"color:#000"> </span><span style=3D"color:#=
606">Health</span><span style=3D"color:#000"><br></span><span style=3D"colo=
r:#660">{</span><span style=3D"color:#000"><br>=C2=A0 </span><span style=3D=
"color:#008">int</span><span style=3D"color:#000"> </span><span style=3D"co=
lor:#606">Current</span><span style=3D"color:#660">;</span><span style=3D"c=
olor:#000"><br>=C2=A0 </span><span style=3D"color:#008">int</span><span sty=
le=3D"color:#000"> </span><span style=3D"color:#606">Max</span><span style=
=3D"color:#660">;</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#660">}</span></div></code></div><span style=3D"color:rgb(0,0,136=
)"><br></span></div><div>But then be easily able to get a container like th=
is automatically:</div><div><br></div><div style=3D"background-color:rgb(25=
0,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1p=
x;word-wrap:break-word"><code><div><span style=3D"color:#008">struct</span>=
<span style=3D"color:#000"> </span><span style=3D"color:#606">HealthSoA</sp=
an><span style=3D"color:#000"><br></span><span style=3D"color:#660">{</span=
><span style=3D"color:#000"><br>=C2=A0 </span><span style=3D"color:#606">Co=
ntainer</span><span style=3D"color:#080">&lt;int&gt;</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#606">Current</span><span style=3D"=
color:#660">;</span><span style=3D"color:#000"><br>=C2=A0 </span><span styl=
e=3D"color:#606">Container</span><span style=3D"color:#080">&lt;int&gt;</sp=
an><span style=3D"color:#000"> </span><span style=3D"color:#606">Max</span>=
<span style=3D"color:#660">;</span><span style=3D"color:#000"><br></span><s=
pan style=3D"color:#660">}</span></div></code></div><div><br></div><div><br=
></div><div>The ideal syntax for getting this being something similar to:=
=C2=A0</div><div><br></div><div style=3D"background-color:rgb(250,250,250);=
border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap=
:break-word"><code><div><span style=3D"color:#008">struct</span><span style=
=3D"color:#000"> </span><span style=3D"color:#606">HealthSoA</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#660">:</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">public</span><span style=
=3D"color:#000"> </span><span style=3D"color:#606">SoA</span><span style=3D=
"color:#660">&lt;</span><span style=3D"color:#606">Health</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000"> std</span><span style=
=3D"color:#660">::</span><span style=3D"color:#000">array</span><span style=
=3D"color:#660">&gt;</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">{}</span><span style=3D"color:#000"><br></span></div></code=
></div><div><br></div><div>But I&#39;m not sure this is possible without re=
flection, I don&#39;t think any template wizardry could create this but I w=
ould love to be proven wrong.</div></div></blockquote><div><br></div><div><=
br></div><div>The good news is that it&#39;s definitely possible <i>with</i=
>=C2=A0reflection, and that&#39;s coming. Not for C++20, but could be for C=
++23. Any specific language feature for this case would be known throw-away=
 work - not sure it&#39;s worth it for this?</div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/1f2c9cae-07f8-4cd2-95ea-8ba0751673b0%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/1f2c9cae-07f8-4cd2-95ea-8ba0751673b0=
%40isocpp.org</a>.<br />

------=_Part_154_245575510.1534379837191--

------=_Part_153_417607079.1534379837190--

.


Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Thu, 16 Aug 2018 03:23:08 +0100
Raw View
--0000000000005e450b0573842023
Content-Type: text/plain; charset="UTF-8"

First thoughts: beautiful concept. Even outside of graphics, it allows
fairly effortless exploitation of cpu cache when your operations are
predominantly column-based.

It will definitely require some reflection to get from Health to HealthSoA
without changing Health.

If you're up for changing Health a little, though, you might be in luck.
I'm not 100% on this working, and its a bit of a ramble, but it's worth
writing just incase it provides some inspiration.

1) Define some SoA_able<S,Ts...> struct (with no members) which simply
defines some tuple types - reference_type (std::tuple<Ts&...>) a
conversion_type (S), container_type (std::tuple<container<Ts>...), an
iterator_type (std::tuple<container<Ts>::iterator...>). These are purely
for reference by (2).

2) Define an SoA struct which takes in an SoA_able as a template parameter,
and construct a tuple of containers for each of the Ts (here int, int).
Define an SoA_iterator which stores a SoA_able::iterator_type (I'd suggest
using the <head, tail...> idiom), and dereferences to the
SoA_able::reference_type for const and non-const, and an
SoA_able::conversion_type (a.k.a Health, as you'll see in (3)) for const
(non-const wouldn't make sense, because you have to copy tuple values into
Health). If this sounds familiar, the SoA struct is acting as a zip class,
spruced up to provide a const Health on iteration.

3) Make Health extend SoA_able<Health, int, int> and provide a conversion
from Health to tuple<int, int>. Yep, CRTP makes a curious appearance yet
again (to provide a converted return type from tuple to Health). These are
the only modifications needed for Health.

If you want the SoA to provide push_back, remember that it restricts your
choice of containers. If youre happy with that, accept a Health as an
argument and use the tuple conversion to extract the values, inserting them
one-by-one into each container in the SoA's tuple of containers.

Then you can create your SoA with SoA<Health> and iterate over it using:

for(auto& [max, current] : my_soa){
    // use max and current separately
}

for(const Health& h : my_soa){
   // This is the part I'm not sure about.
   // I'm assuming that range-based for
   // detects the required type from
   // the iterator dereference - not
   // something I have tried before.
}

Noting, of course, that by doing such an iteration over all values you're
losing any benefits of the storage order. There might be a way of isolating
just the values you want via

for(auto& [max] : my_soa.get_column<0>()){

}

Or, if you want a reference to the name, define column numbers as a const
static Health and use:
for(auto& [max] : my_soa.get_column<Health::col_max>())

Obviously, this isn't pretty. I'd love to see what someone in the
reflection inner-circle would suggest to do on the basis that their
proposal makes progress.

On Thu, 16 Aug 2018, 00:42 Alexander Brook Perry, <alex@alexgeek.co.uk>
wrote:

> Hey,
>
> Does anyone know if there are any existing proposals to standardise using
> Structures of Arrays (SoA) over Arrays of Structures (AoS)?
>
> I've seen a lot of advocacy for the SoA approach in gameplay and graphics
> programming but it doesn't seem to fit in with the core language without
> typing error prone boilerplate.
>
> It would be great to define a POD structure like the following:
>
> struct Health
> {
>   int Current;
>   int Max;
> }
>
> But then be easily able to get a container like this automatically:
>
> struct HealthSoA
> {
>   Container<int> Current;
>   Container<int> Max;
> }
>
>
> The ideal syntax for getting this being something similar to:
>
> struct HealthSoA : public SoA<Health, std::array> {}
>
> But I'm not sure this is possible without reflection, I don't think any
> template wizardry could create this but I would love to be proven wrong.
>
> It would also be ideal to generate a reference of pointer based version of
> the POD automatically too like this:
>
> struct HealthByRef
> {
>   int& Current;
>   int& Max;
> }
>
>
> Where each member reference the value stored in the SoA container. I'm not
> saying that is a good but would allow flexibility / interop of with AoS
> code.
>
> Maybe this would be a nested type of the SoA e.g. HealthSoA::ReferenceType
> or HealthSoA::PointerType.
>
> E.g. in following we often want to use the same container type like a
> std::vector
>
> template<typename T>
> struct VectorSoA : public SoA<T, std::vector>
> {
>   // match the members of std::vector<T> but store in SoA individual
> containers
>   SoA<T, std::vector>::ReferenceType operator[](size_t index) const {
> return /* ??? */ ; }
>
>   void push_back(const T& value) { /* ??? */ }
>
>   // etc.
> }
>
>
>
> Thoughts?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/d46fccdb-9d56-47d1-8a32-33b077fcb120%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/d46fccdb-9d56-47d1-8a32-33b077fcb120%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCM-NSzu5FGZjwMws4ciPVW3N1KCNDwdEjxOd%2BdBFg%3DfWg%40mail.gmail.com.

--0000000000005e450b0573842023
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div>First thoughts: beautiful concept. Even outside of g=
raphics, it allows fairly effortless exploitation of cpu cache when your op=
erations are predominantly column-based.</div><div dir=3D"auto"><br></div><=
div dir=3D"auto">It will definitely require some reflection to get from Hea=
lth to HealthSoA without changing Health.</div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">If you&#39;re up for changing Health a little, though, yo=
u might be in luck. I&#39;m not 100% on this working, and its a bit of a ra=
mble, but it&#39;s worth writing just incase it provides some inspiration.<=
/div><div dir=3D"auto"><br></div><div dir=3D"auto">1) Define some SoA_able&=
lt;S,Ts...&gt; struct (with no members) which simply defines some tuple typ=
es -=C2=A0<span style=3D"font-family:sans-serif">reference_type (std::tuple=
&lt;Ts&amp;...&gt;) a conversion_type (S), container_type (std::tuple&lt;co=
ntainer&lt;Ts&gt;...), an iterator_type=C2=A0</span><span style=3D"font-fam=
ily:sans-serif">(std::tuple&lt;container&lt;Ts&gt;::iterator...&gt;). These=
 are purely for reference by (2).</span></div><div dir=3D"auto"><span style=
=3D"font-family:sans-serif"><br></span></div><div dir=3D"auto"><span style=
=3D"font-family:sans-serif">2) Define=C2=A0</span><font face=3D"sans-serif"=
>an SoA struct which takes in an SoA_able as a template parameter, and cons=
truct a tuple of containers for each of the Ts (here int, int). Define an S=
oA_iterator which stores a SoA_able::iterator_type (I&#39;d suggest using t=
he &lt;head, tail...&gt; idiom), and dereferences to the SoA_able::referenc=
e_type for const and non-const, and an SoA_able::conversion_type (a.k.a Hea=
lth, as you&#39;ll see in (3)) for const (non-const wouldn&#39;t make sense=
, because you have to copy tuple values into Health). If this sounds famili=
ar, the SoA struct is acting as a zip class, spruced up to provide a const =
Health on iteration.</font></div><div dir=3D"auto"><font face=3D"sans-serif=
"><br></font></div><div dir=3D"auto"><span style=3D"font-family:sans-serif"=
>3) Make Health extend SoA_able&lt;Health, int, int&gt; and provide a conve=
rsion from Health to tuple&lt;int, int&gt;. Yep, CRTP makes a curious appea=
rance yet again (to provide a converted return type from tuple to Health). =
These are the only modifications needed for Health.</span><span style=3D"fo=
nt-family:sans-serif"><br></span></div><div dir=3D"auto"><br></div><div dir=
=3D"auto"><span style=3D"font-family:sans-serif">If you want the SoA to pro=
vide push_back, remember that it restricts your choice of containers. If yo=
ure happy with that, accept a Health as an argument and use the tuple conve=
rsion to extract the values, inserting them one-by-one into each container =
in the SoA&#39;s tuple of containers.</span></div><div dir=3D"auto"><span s=
tyle=3D"font-family:sans-serif"><br></span></div><div dir=3D"auto"><span st=
yle=3D"font-family:sans-serif">Then you can create your SoA with SoA&lt;Hea=
lth&gt; and iterate over it using:</span></div><div dir=3D"auto"><span styl=
e=3D"font-family:sans-serif"><br></span></div><div dir=3D"auto"><span style=
=3D"font-family:sans-serif">for(auto&amp; [max, current] : my_soa){</span><=
/div><div dir=3D"auto"><span style=3D"font-family:sans-serif">=C2=A0 =C2=A0=
 // use max and current separately</span></div><div dir=3D"auto"><font face=
=3D"sans-serif">}</font></div><div dir=3D"auto"><font face=3D"sans-serif"><=
br></font></div><div dir=3D"auto"><font face=3D"sans-serif">for(const Healt=
h&amp; h : my_soa){</font></div><div dir=3D"auto"><font face=3D"sans-serif"=
>=C2=A0 =C2=A0// This is the part I&#39;m not sure about.</font></div><div =
dir=3D"auto"><font face=3D"sans-serif">=C2=A0 =C2=A0// I&#39;m assuming tha=
t range-based for</font></div><div dir=3D"auto"><font face=3D"sans-serif">=
=C2=A0 =C2=A0// detects the required type from</font></div><div dir=3D"auto=
"><font face=3D"sans-serif">=C2=A0 =C2=A0// the iterator dereference - not<=
/font></div><div dir=3D"auto"><font face=3D"sans-serif">=C2=A0 =C2=A0// som=
ething I have tried before.</font></div><div dir=3D"auto"><font face=3D"san=
s-serif">}</font></div><div dir=3D"auto"><font face=3D"sans-serif"><br></fo=
nt></div><div dir=3D"auto"><font face=3D"sans-serif">Noting, of course, tha=
t by doing such an iteration over all values you&#39;re losing any benefits=
 of the storage order. There might be a way of isolating just the values yo=
u want via</font></div><div dir=3D"auto"><font face=3D"sans-serif"><br></fo=
nt></div><div dir=3D"auto"><font face=3D"sans-serif">for(auto&amp; [max] : =
my_soa.get_column&lt;0&gt;()){</font></div><div dir=3D"auto"><font face=3D"=
sans-serif"><br></font></div><div dir=3D"auto"><font face=3D"sans-serif">}<=
/font></div><div dir=3D"auto"><font face=3D"sans-serif"><br></font></div><d=
iv dir=3D"auto"><font face=3D"sans-serif">Or, if you want a reference to th=
e name, define column numbers as a const static Health and use:</font></div=
><div dir=3D"auto"><font face=3D"sans-serif">for(auto&amp; [max] : my_soa.g=
et_column&lt;Health::col_max&gt;())</font></div><div dir=3D"auto"><font fac=
e=3D"sans-serif"><br></font></div><div dir=3D"auto"><font face=3D"sans-seri=
f">Obviously, this isn&#39;t pretty. I&#39;d love to see what someone in th=
e reflection inner-circle would suggest to do on the basis that their propo=
sal makes progress.</font></div><div dir=3D"auto"><br></div><div dir=3D"aut=
o"><div class=3D"gmail_quote" dir=3D"auto"><div dir=3D"ltr">On Thu, 16 Aug =
2018, 00:42 Alexander Brook Perry, &lt;<a href=3D"mailto:alex@alexgeek.co.u=
k" target=3D"_blank" rel=3D"noreferrer">alex@alexgeek.co.uk</a>&gt; wrote:<=
br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hey,<div><br></div=
><div>Does anyone know if there are any existing proposals to standardise u=
sing Structures of Arrays (SoA) over Arrays of Structures (AoS)?=C2=A0</div=
><div><br></div><div>I&#39;ve seen a lot of advocacy for the SoA approach i=
n gameplay and graphics programming but it doesn&#39;t seem to fit in with =
the core language without typing error prone boilerplate.</div><div><br></d=
iv><div>It would be great to define a POD structure like the following:</di=
v><div><br></div><div><div class=3D"m_1487467234556555956m_-161647682337289=
6051prettyprint" style=3D"background-color:rgb(250,250,250);border-color:rg=
b(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><c=
ode class=3D"m_1487467234556555956m_-1616476823372896051prettyprint"><div c=
lass=3D"m_1487467234556555956m_-1616476823372896051subprettyprint"><span st=
yle=3D"color:#008" class=3D"m_1487467234556555956m_-1616476823372896051styl=
ed-by-prettify">struct</span><span style=3D"color:#000" class=3D"m_14874672=
34556555956m_-1616476823372896051styled-by-prettify"> </span><span style=3D=
"color:#606" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-=
prettify">Health</span><span style=3D"color:#000" class=3D"m_14874672345565=
55956m_-1616476823372896051styled-by-prettify"><br></span><span style=3D"co=
lor:#660" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pre=
ttify">{</span><span style=3D"color:#000" class=3D"m_1487467234556555956m_-=
1616476823372896051styled-by-prettify"><br>=C2=A0 </span><span style=3D"col=
or:#008" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pret=
tify">int</span><span style=3D"color:#000" class=3D"m_1487467234556555956m_=
-1616476823372896051styled-by-prettify"> </span><span style=3D"color:#606" =
class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">Cur=
rent</span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-1616=
476823372896051styled-by-prettify">;</span><span style=3D"color:#000" class=
=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"><br>=C2=
=A0 </span><span style=3D"color:#008" class=3D"m_1487467234556555956m_-1616=
476823372896051styled-by-prettify">int</span><span style=3D"color:#000" cla=
ss=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </spa=
n><span style=3D"color:#606" class=3D"m_1487467234556555956m_-1616476823372=
896051styled-by-prettify">Max</span><span style=3D"color:#660" class=3D"m_1=
487467234556555956m_-1616476823372896051styled-by-prettify">;</span><span s=
tyle=3D"color:#000" class=3D"m_1487467234556555956m_-1616476823372896051sty=
led-by-prettify"><br></span><span style=3D"color:#660" class=3D"m_148746723=
4556555956m_-1616476823372896051styled-by-prettify">}</span></div></code></=
div><span style=3D"color:rgb(0,0,136)"><br></span></div><div>But then be ea=
sily able to get a container like this automatically:</div><div><br></div><=
div class=3D"m_1487467234556555956m_-1616476823372896051prettyprint" style=
=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-=
style:solid;border-width:1px;word-wrap:break-word"><code class=3D"m_1487467=
234556555956m_-1616476823372896051prettyprint"><div class=3D"m_148746723455=
6555956m_-1616476823372896051subprettyprint"><span style=3D"color:#008" cla=
ss=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">struct=
</span><span style=3D"color:#000" class=3D"m_1487467234556555956m_-16164768=
23372896051styled-by-prettify"> </span><span style=3D"color:#606" class=3D"=
m_1487467234556555956m_-1616476823372896051styled-by-prettify">HealthSoA</s=
pan><span style=3D"color:#000" class=3D"m_1487467234556555956m_-16164768233=
72896051styled-by-prettify"><br></span><span style=3D"color:#660" class=3D"=
m_1487467234556555956m_-1616476823372896051styled-by-prettify">{</span><spa=
n style=3D"color:#000" class=3D"m_1487467234556555956m_-1616476823372896051=
styled-by-prettify"><br>=C2=A0 </span><span style=3D"color:#606" class=3D"m=
_1487467234556555956m_-1616476823372896051styled-by-prettify">Container</sp=
an><span style=3D"color:#080" class=3D"m_1487467234556555956m_-161647682337=
2896051styled-by-prettify">&lt;int&gt;</span><span style=3D"color:#000" cla=
ss=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </spa=
n><span style=3D"color:#606" class=3D"m_1487467234556555956m_-1616476823372=
896051styled-by-prettify">Current</span><span style=3D"color:#660" class=3D=
"m_1487467234556555956m_-1616476823372896051styled-by-prettify">;</span><sp=
an style=3D"color:#000" class=3D"m_1487467234556555956m_-161647682337289605=
1styled-by-prettify"><br>=C2=A0 </span><span style=3D"color:#606" class=3D"=
m_1487467234556555956m_-1616476823372896051styled-by-prettify">Container</s=
pan><span style=3D"color:#080" class=3D"m_1487467234556555956m_-16164768233=
72896051styled-by-prettify">&lt;int&gt;</span><span style=3D"color:#000" cl=
ass=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </sp=
an><span style=3D"color:#606" class=3D"m_1487467234556555956m_-161647682337=
2896051styled-by-prettify">Max</span><span style=3D"color:#660" class=3D"m_=
1487467234556555956m_-1616476823372896051styled-by-prettify">;</span><span =
style=3D"color:#000" class=3D"m_1487467234556555956m_-1616476823372896051st=
yled-by-prettify"><br></span><span style=3D"color:#660" class=3D"m_14874672=
34556555956m_-1616476823372896051styled-by-prettify">}</span></div></code><=
/div><div><br></div><div><br></div><div>The ideal syntax for getting this b=
eing something similar to:=C2=A0</div><div><br></div><div class=3D"m_148746=
7234556555956m_-1616476823372896051prettyprint" style=3D"background-color:r=
gb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-wid=
th:1px;word-wrap:break-word"><code class=3D"m_1487467234556555956m_-1616476=
823372896051prettyprint"><div class=3D"m_1487467234556555956m_-161647682337=
2896051subprettyprint"><span style=3D"color:#008" class=3D"m_14874672345565=
55956m_-1616476823372896051styled-by-prettify">struct</span><span style=3D"=
color:#000" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-p=
rettify"> </span><span style=3D"color:#606" class=3D"m_1487467234556555956m=
_-1616476823372896051styled-by-prettify">HealthSoA</span><span style=3D"col=
or:#000" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pret=
tify"> </span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-1=
616476823372896051styled-by-prettify">:</span><span style=3D"color:#000" cl=
ass=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </sp=
an><span style=3D"color:#008" class=3D"m_1487467234556555956m_-161647682337=
2896051styled-by-prettify">public</span><span style=3D"color:#000" class=3D=
"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </span><sp=
an style=3D"color:#606" class=3D"m_1487467234556555956m_-161647682337289605=
1styled-by-prettify">SoA</span><span style=3D"color:#660" class=3D"m_148746=
7234556555956m_-1616476823372896051styled-by-prettify">&lt;</span><span sty=
le=3D"color:#606" class=3D"m_1487467234556555956m_-1616476823372896051style=
d-by-prettify">Health</span><span style=3D"color:#660" class=3D"m_148746723=
4556555956m_-1616476823372896051styled-by-prettify">,</span><span style=3D"=
color:#000" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-p=
rettify"> std</span><span style=3D"color:#660" class=3D"m_14874672345565559=
56m_-1616476823372896051styled-by-prettify">::</span><span style=3D"color:#=
000" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify=
">array</span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-1=
616476823372896051styled-by-prettify">&gt;</span><span style=3D"color:#000"=
 class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> <=
/span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-161647682=
3372896051styled-by-prettify">{}</span><span style=3D"color:#000" class=3D"=
m_1487467234556555956m_-1616476823372896051styled-by-prettify"><br></span><=
/div></code></div><div><br></div><div>But I&#39;m not sure this is possible=
 without reflection, I don&#39;t think any template wizardry could create t=
his but I would love to be proven wrong.</div><div><br></div><div>It would =
also be ideal to generate a reference of pointer based version of the POD a=
utomatically too like this:</div><div><br></div><div class=3D"m_14874672345=
56555956m_-1616476823372896051prettyprint" style=3D"background-color:rgb(25=
0,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1p=
x;word-wrap:break-word"><code class=3D"m_1487467234556555956m_-161647682337=
2896051prettyprint"><div class=3D"m_1487467234556555956m_-16164768233728960=
51subprettyprint"><span style=3D"color:#008" class=3D"m_1487467234556555956=
m_-1616476823372896051styled-by-prettify">struct</span><span style=3D"color=
:#000" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pretti=
fy"> </span><span style=3D"color:#606" class=3D"m_1487467234556555956m_-161=
6476823372896051styled-by-prettify">HealthByRef</span><span style=3D"color:=
#000" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettif=
y"><br></span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-1=
616476823372896051styled-by-prettify">{</span><span style=3D"color:#000" cl=
ass=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"><br>=
=C2=A0 </span><span style=3D"color:#008" class=3D"m_1487467234556555956m_-1=
616476823372896051styled-by-prettify">int</span><span style=3D"color:#660" =
class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">&am=
p;</span><span style=3D"color:#000" class=3D"m_1487467234556555956m_-161647=
6823372896051styled-by-prettify"> </span><span style=3D"color:#606" class=
=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">Current<=
/span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-161647682=
3372896051styled-by-prettify">;</span><span style=3D"color:#000" class=3D"m=
_1487467234556555956m_-1616476823372896051styled-by-prettify"><br>=C2=A0 </=
span><span style=3D"color:#008" class=3D"m_1487467234556555956m_-1616476823=
372896051styled-by-prettify">int</span><span style=3D"color:#660" class=3D"=
m_1487467234556555956m_-1616476823372896051styled-by-prettify">&amp;</span>=
<span style=3D"color:#000" class=3D"m_1487467234556555956m_-161647682337289=
6051styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_14874=
67234556555956m_-1616476823372896051styled-by-prettify">Max</span><span sty=
le=3D"color:#660" class=3D"m_1487467234556555956m_-1616476823372896051style=
d-by-prettify">;</span><span style=3D"color:#000" class=3D"m_14874672345565=
55956m_-1616476823372896051styled-by-prettify"><br></span><span style=3D"co=
lor:#660" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pre=
ttify">}</span></div></code></div><div><br></div><div><br></div><div>Where =
each member reference the value stored in the SoA container. I&#39;m not sa=
ying that is a good but would allow flexibility / interop of with AoS code.=
=C2=A0</div><div><br></div><div>Maybe this would be a nested type of the So=
A e.g. HealthSoA::ReferenceType or HealthSoA::PointerType.=C2=A0</div><div>=
<br></div><div>E.g. in following we often want to use the same container ty=
pe like a std::vector</div><div><div><br></div><div class=3D"m_148746723455=
6555956m_-1616476823372896051prettyprint" style=3D"background-color:rgb(250=
,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px=
;word-wrap:break-word"><code class=3D"m_1487467234556555956m_-1616476823372=
896051prettyprint"><div class=3D"m_1487467234556555956m_-161647682337289605=
1subprettyprint"><span style=3D"color:#008" class=3D"m_1487467234556555956m=
_-1616476823372896051styled-by-prettify">template</span><span style=3D"colo=
r:#660" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prett=
ify">&lt;</span><span style=3D"color:#008" class=3D"m_1487467234556555956m_=
-1616476823372896051styled-by-prettify">typename</span><span style=3D"color=
:#000" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pretti=
fy"> T</span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-16=
16476823372896051styled-by-prettify">&gt;</span><span style=3D"color:#000" =
class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"><br=
></span><span style=3D"color:#008" class=3D"m_1487467234556555956m_-1616476=
823372896051styled-by-prettify">struct</span><span style=3D"color:#000" cla=
ss=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </spa=
n><span style=3D"color:#606" class=3D"m_1487467234556555956m_-1616476823372=
896051styled-by-prettify">VectorSoA</span><span style=3D"color:#000" class=
=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </span>=
<span style=3D"color:#660" class=3D"m_1487467234556555956m_-161647682337289=
6051styled-by-prettify">:</span><span style=3D"color:#000" class=3D"m_14874=
67234556555956m_-1616476823372896051styled-by-prettify"> </span><span style=
=3D"color:#008" class=3D"m_1487467234556555956m_-1616476823372896051styled-=
by-prettify">public</span><span style=3D"color:#000" class=3D"m_14874672345=
56555956m_-1616476823372896051styled-by-prettify"> </span><span style=3D"co=
lor:#606" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pre=
ttify">SoA</span><span style=3D"color:#660" class=3D"m_1487467234556555956m=
_-1616476823372896051styled-by-prettify">&lt;</span><span style=3D"color:#0=
00" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"=
>T</span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-161647=
6823372896051styled-by-prettify">,</span><span style=3D"color:#000" class=
=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> std</sp=
an><span style=3D"color:#660" class=3D"m_1487467234556555956m_-161647682337=
2896051styled-by-prettify">::</span><span style=3D"color:#000" class=3D"m_1=
487467234556555956m_-1616476823372896051styled-by-prettify">vector</span><s=
pan style=3D"color:#660" class=3D"m_1487467234556555956m_-16164768233728960=
51styled-by-prettify">&gt;</span><span style=3D"color:#000" class=3D"m_1487=
467234556555956m_-1616476823372896051styled-by-prettify"><br></span><span s=
tyle=3D"color:#660" class=3D"m_1487467234556555956m_-1616476823372896051sty=
led-by-prettify">{</span><span style=3D"color:#000" class=3D"m_148746723455=
6555956m_-1616476823372896051styled-by-prettify"><br>=C2=A0 </span><span st=
yle=3D"color:#800" class=3D"m_1487467234556555956m_-1616476823372896051styl=
ed-by-prettify">// match the members of std::vector&lt;T&gt; but store in S=
oA individual containers</span><span style=3D"color:#000" class=3D"m_148746=
7234556555956m_-1616476823372896051styled-by-prettify"><br>=C2=A0 </span><s=
pan style=3D"color:#606" class=3D"m_1487467234556555956m_-16164768233728960=
51styled-by-prettify">SoA</span><span style=3D"color:#660" class=3D"m_14874=
67234556555956m_-1616476823372896051styled-by-prettify">&lt;</span><span st=
yle=3D"color:#000" class=3D"m_1487467234556555956m_-1616476823372896051styl=
ed-by-prettify">T</span><span style=3D"color:#660" class=3D"m_1487467234556=
555956m_-1616476823372896051styled-by-prettify">,</span><span style=3D"colo=
r:#000" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prett=
ify"> std</span><span style=3D"color:#660" class=3D"m_1487467234556555956m_=
-1616476823372896051styled-by-prettify">::</span><span style=3D"color:#000"=
 class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">ve=
ctor</span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-1616=
476823372896051styled-by-prettify">&gt;::</span><span style=3D"color:#606" =
class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">Ref=
erenceType</span><span style=3D"color:#000" class=3D"m_1487467234556555956m=
_-1616476823372896051styled-by-prettify"> </span><span style=3D"color:#008"=
 class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">op=
erator</span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-16=
16476823372896051styled-by-prettify">[](</span><span style=3D"color:#000" c=
lass=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">size=
_t index</span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-=
1616476823372896051styled-by-prettify">)</span><span style=3D"color:#000" c=
lass=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </s=
pan><span style=3D"color:#008" class=3D"m_1487467234556555956m_-16164768233=
72896051styled-by-prettify">const</span><span style=3D"color:#000" class=3D=
"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> </span><sp=
an style=3D"color:#660" class=3D"m_1487467234556555956m_-161647682337289605=
1styled-by-prettify">{</span><span style=3D"color:#000" class=3D"m_14874672=
34556555956m_-1616476823372896051styled-by-prettify"> </span><span style=3D=
"color:#008" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-=
prettify">return</span><span style=3D"color:#000" class=3D"m_14874672345565=
55956m_-1616476823372896051styled-by-prettify"> </span><span style=3D"color=
:#800" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pretti=
fy">/* ??? */</span><span style=3D"color:#000" class=3D"m_14874672345565559=
56m_-1616476823372896051styled-by-prettify"> </span><span style=3D"color:#6=
60" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"=
>;</span><span style=3D"color:#000" class=3D"m_1487467234556555956m_-161647=
6823372896051styled-by-prettify"> </span><span style=3D"color:#660" class=
=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify">}</span>=
<span style=3D"color:#000" class=3D"m_1487467234556555956m_-161647682337289=
6051styled-by-prettify"><br>=C2=A0 <br>=C2=A0 </span><span style=3D"color:#=
008" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify=
">void</span><span style=3D"color:#000" class=3D"m_1487467234556555956m_-16=
16476823372896051styled-by-prettify"> push_back</span><span style=3D"color:=
#660" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettif=
y">(</span><span style=3D"color:#008" class=3D"m_1487467234556555956m_-1616=
476823372896051styled-by-prettify">const</span><span style=3D"color:#000" c=
lass=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> T</=
span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-1616476823=
372896051styled-by-prettify">&amp;</span><span style=3D"color:#000" class=
=3D"m_1487467234556555956m_-1616476823372896051styled-by-prettify"> value</=
span><span style=3D"color:#660" class=3D"m_1487467234556555956m_-1616476823=
372896051styled-by-prettify">)</span><span style=3D"color:#000" class=3D"m_=
1487467234556555956m_-1616476823372896051styled-by-prettify"> </span><span =
style=3D"color:#660" class=3D"m_1487467234556555956m_-1616476823372896051st=
yled-by-prettify">{</span><span style=3D"color:#000" class=3D"m_14874672345=
56555956m_-1616476823372896051styled-by-prettify"> </span><span style=3D"co=
lor:#800" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pre=
ttify">/* ??? */</span><span style=3D"color:#000" class=3D"m_14874672345565=
55956m_-1616476823372896051styled-by-prettify"> </span><span style=3D"color=
:#660" class=3D"m_1487467234556555956m_-1616476823372896051styled-by-pretti=
fy">}</span><span style=3D"color:#000" class=3D"m_1487467234556555956m_-161=
6476823372896051styled-by-prettify"><br>=C2=A0 <br>=C2=A0 </span><span styl=
e=3D"color:#800" class=3D"m_1487467234556555956m_-1616476823372896051styled=
-by-prettify">// etc.</span><span style=3D"color:#000" class=3D"m_148746723=
4556555956m_-1616476823372896051styled-by-prettify"><br></span><span style=
=3D"color:#660" class=3D"m_1487467234556555956m_-1616476823372896051styled-=
by-prettify">}</span></div></code></div><div><br><br></div></div><div><br><=
/div><div>Thoughts?=C2=A0</div><div><br></div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" rel=3D"nore=
ferrer noreferrer" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</=
a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" rel=3D"noreferrer noreferrer" target=3D"_blank">std-proposals@isocpp.=
org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/d46fccdb-9d56-47d1-8a32-33b077fcb120%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"noreferrer =
noreferrer" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgi=
d/std-proposals/d46fccdb-9d56-47d1-8a32-33b077fcb120%40isocpp.org</a>.<br>
</blockquote></div></div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCM-NSzu5FGZjwMws4ciPVW3N1KCND=
wdEjxOd%2BdBFg%3DfWg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCM-=
NSzu5FGZjwMws4ciPVW3N1KCNDwdEjxOd%2BdBFg%3DfWg%40mail.gmail.com</a>.<br />

--0000000000005e450b0573842023--

.


Author: John McFarlane <john@mcfarlane.name>
Date: Thu, 16 Aug 2018 11:55:04 +0100
Raw View
--000000000000382d9805738b47d6
Content-Type: text/plain; charset="UTF-8"

On Thu, 16 Aug 2018 at 00:42 Alexander Brook Perry <alex@alexgeek.co.uk>
wrote:

> Hey,
>
> Does anyone know if there are any existing proposals to standardise using
> Structures of Arrays (SoA) over Arrays of Structures (AoS)?
>
> I've seen a lot of advocacy for the SoA approach in gameplay and graphics
> programming but it doesn't seem to fit in with the core language without
> typing error prone boilerplate.
>

SoA is raised in SG14 from time to time, e.g.:
https://groups.google.com/a/isocpp.org/d/topic/sg14/iw4Yn3kLXIg/discussion
https://groups.google.com/a/isocpp.org/d/topic/sg14/37sA73EJnRc/discussion
Regards,
John

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5WXPYazGqa6R5ba%3DLMRi%3DOFreq%3D4TJYW-V3AbHkM0A%40mail.gmail.com.

--000000000000382d9805738b47d6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Thu, 16 Aug=
 2018 at 00:42 Alexander Brook Perry &lt;<a href=3D"mailto:alex@alexgeek.co=
..uk">alex@alexgeek.co.uk</a>&gt; wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr">Hey,<div><br></div><div>Does anyone know if there are=
 any existing proposals to standardise using Structures of Arrays (SoA) ove=
r Arrays of Structures (AoS)?=C2=A0</div><div><br></div><div>I&#39;ve seen =
a lot of advocacy for the SoA approach in gameplay and graphics programming=
 but it doesn&#39;t seem to fit in with the core language without typing er=
ror prone boilerplate.</div></div></blockquote><div><br></div><div>SoA is r=
aised in SG14 from time to time, e.g.:</div><div><a href=3D"https://groups.=
google.com/a/isocpp.org/d/topic/sg14/iw4Yn3kLXIg/discussion">https://groups=
..google.com/a/isocpp.org/d/topic/sg14/iw4Yn3kLXIg/discussion</a></div><div>=
<a href=3D"https://groups.google.com/a/isocpp.org/d/topic/sg14/37sA73EJnRc/=
discussion">https://groups.google.com/a/isocpp.org/d/topic/sg14/37sA73EJnRc=
/discussion</a></div><div>Regards,</div><div>John</div></div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5WXPYazGqa6R5ba%3DLMRi%3DOFr=
eq%3D4TJYW-V3AbHkM0A%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5W=
XPYazGqa6R5ba%3DLMRi%3DOFreq%3D4TJYW-V3AbHkM0A%40mail.gmail.com</a>.<br />

--000000000000382d9805738b47d6--

.


Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Thu, 16 Aug 2018 19:38:41 +0100
Raw View
--0000000000009935f5057391c086
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

This
<https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAKxAEZSAbAQw=
DtRkBSAJgCFufSAZ1QBXYskwgA5NwDMeFsgYisAag6yAwgREAHBpg3YOABgCCchUpWZ1WgG6ZkR=
YkdMWu8xcrUbNAMxFFAjxUFiYGN3NLbxs7TREQhkIATyiLc3CAW0xBXSYJVR19TAB9RLwGQQ4Ad=
j5zVUbVbNz8wrws/Vr6sya%2BosxO5gJDLQIU3UwW1QAVUiKJqaYc1QAxecE8AC8yggA6A9UASW=
rZYwb%2BxrQWQRGAD11iVSZE1FUspl0Ia9vZ7gA2IrzH4ENYA1T%2BDYEdAg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KyD0CqCaD6m6CGlPAMnrRUkNlMkskUHsmyBBJ7Ccn/BcA1CyD/BNmckTGyC3kSn4nSmkB=
ZAgCcncnGG0DLlcBjFpFcCCnvk1B9nBmKnKkgCqkHmak6kQBICiAEB8xJQUA%2BhmlrggDwlaEL=
kWn0DRxRy6DZndkEkyn9nCyeDwlqlkkUEQpMBYAWlbiSlSDPmvm/GnninHl8lBL/BCm/EmBAWyn=
ymgVCDgWkDkUalam6lwUIXGnIUbnml0CkAYUuByU4WfD4X0W9l8XknSAMmqDRyEAT6DnDmjnjmT=
nTn7nqkUFPlEmvmyCyB7A2X2UOWOXAX8XSBgUQXmVskgDHksUXlXk3l3kPn0WyBEUgWuXCUHkEV=
cAhUuVKnhUeWkCsybBhBvlAA%3D%3D%3D>
is an example of what can be done right now, based on the approach I
described above.

I've included a demonstration on iterating through a single column,
followed by iterating through structs.

Health warning (pun unintended): the boilerplate isn't pretty, but the
modifications to Health aren't so bad. On the upside, GCC digests it pretty
well with -O1. The equivalent for the AoS has fewer
<https://godbolt.org/g/j2bSBj> instructions, but the SoA performance is
noticably better <http://quick-bench.com/AShU4NH6p0ulFD1oAsGCmR8FIZs>
(boilerplate ends at line 200) for column-based operations (because of cpu
cache) when the struct contains more than just two ints.

It isn't very useful in it's current form (looping through e.g. N struct
variables out of many would be a nice addition), but it's easy enough to
use.

On Thu, Aug 16, 2018 at 11:55 AM, John McFarlane <john@mcfarlane.name>
wrote:

> On Thu, 16 Aug 2018 at 00:42 Alexander Brook Perry <alex@alexgeek.co.uk>
> wrote:
>
>> Hey,
>>
>> Does anyone know if there are any existing proposals to standardise usin=
g
>> Structures of Arrays (SoA) over Arrays of Structures (AoS)?
>>
>> I've seen a lot of advocacy for the SoA approach in gameplay and graphic=
s
>> programming but it doesn't seem to fit in with the core language without
>> typing error prone boilerplate.
>>
>
> SoA is raised in SG14 from time to time, e.g.:
> https://groups.google.com/a/isocpp.org/d/topic/sg14/iw4Yn3kLXIg/discussio=
n
> https://groups.google.com/a/isocpp.org/d/topic/sg14/37sA73EJnRc/discussio=
n
> Regards,
> John
>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/CABPJVnTh5WXPYazGqa6R5ba%
> 3DLMRi%3DOFreq%3D4TJYW-V3AbHkM0A%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5W=
XPYazGqa6R5ba%3DLMRi%3DOFreq%3D4TJYW-V3AbHkM0A%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
> .
>

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAC%2B0CCNcNTutwc_Uc2jPgX1qSvHpD7cLAV5QKqrCxzReN=
E4bxQ%40mail.gmail.com.

--0000000000009935f5057391c086
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><a href=3D"https://godbolt.org/#z:OYLghAFBqd5QCx=
AYwPYBMCmBRdBLAF1QCcAaPECAKxAEZSAbAQwDtRkBSAJgCFufSAZ1QBXYskwgA5NwDMeFsgYis=
Aag6yAwgREAHBpg3YOABgCCchUpWZ1WgG6ZkRYkdMWu8xcrUbNAMxFFAjxUFiYGN3NLbxs7TREQ=
hkIATyiLc3CAW0xBXSYJVR19TAB9RLwGQQ4Adj5zVUbVbNz8wrws/Vr6sya%2BosxO5gJDLQIU3=
UwW1QAVUiKJqaYc1QAxecE8AC8yggA6A9UASWrZYwb%2BxrQWQRGAD11iVSZE1FUsp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NhcmqDADICX6Cl7BcCqAQC4CEAkC9KyD0CqCaD6m6CGlPAMnrRUkNlMkskUHs=
myBBJ7Ccn/BcA1CyD/BNmckTGyC3kSn4nSmkBZAgCcncnGG0DLlcBjFpFcCCnvk1B9nBmKnKkgC=
qkHmak6kQBICiAEB8xJQUA%2BhmlrggDwlaELkWn0DRxRy6DZndkEkyn9nCyeDwlqlkkUEQpMBY=
AWlbiSlSDPmvm/GnninHl8lBL/BCm/EmBAWynymgVCDgWkDkUalam6lwUIXGnIUbnml0CkAYUuB=
yU4WfD4X0W9l8XknSAMmqDRyEAT6DnDmjnjmTnTn7nqkUFPlEmvmyCyB7A2X2UOWOXAX8XSBgUQ=
XmVskgDHksUXlXk3l3kPn0WyBEUgWuXCUHkEVcAhUuVKnhUeWkCsybBhBvlAA%3D%3D%3D">Thi=
s</a> is an example of what can be done right now, based on the approach I =
described above.<br><br><div>I&#39;ve included a demonstration on iterating=
 through a single column, followed by iterating through structs.</div><br>H=
ealth warning (pun unintended): the boilerplate isn&#39;t pretty, but the m=
odifications to Health aren&#39;t so bad. On the upside, GCC digests it pre=
tty well with -O1. The equivalent for the AoS has <a href=3D"https://godbol=
t.org/g/j2bSBj">fewer</a> instructions, but the SoA performance is noticabl=
y <a href=3D"http://quick-bench.com/AShU4NH6p0ulFD1oAsGCmR8FIZs">better</a>=
 (boilerplate ends at line 200) for column-based operations (because of cpu=
 cache) when the struct contains more than just two ints.<br><br></div><div=
>It isn&#39;t very useful in it&#39;s current form (looping through e.g. N =
struct variables out of many would be a nice addition), but it&#39;s easy e=
nough to use.<br></div></div></div><div class=3D"gmail_extra"><br><div clas=
s=3D"gmail_quote">On Thu, Aug 16, 2018 at 11:55 AM, John McFarlane <span di=
r=3D"ltr">&lt;<a href=3D"mailto:john@mcfarlane.name" target=3D"_blank">john=
@mcfarlane.name</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr"><div class=3D"gmail_quote"><span class=3D""><div dir=3D"ltr">=
On Thu, 16 Aug 2018 at 00:42 Alexander Brook Perry &lt;<a href=3D"mailto:al=
ex@alexgeek.co.uk" target=3D"_blank">alex@alexgeek.co.uk</a>&gt; wrote:<br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hey,<div><br></div><d=
iv>Does anyone know if there are any existing proposals to standardise usin=
g Structures of Arrays (SoA) over Arrays of Structures (AoS)?=C2=A0</div><d=
iv><br></div><div>I&#39;ve seen a lot of advocacy for the SoA approach in g=
ameplay and graphics programming but it doesn&#39;t seem to fit in with the=
 core language without typing error prone boilerplate.</div></div></blockqu=
ote><div><br></div></span><div>SoA is raised in SG14 from time to time, e.g=
..:</div><div><a href=3D"https://groups.google.com/a/isocpp.org/d/topic/sg14=
/iw4Yn3kLXIg/discussion" target=3D"_blank">https://groups.google.com/a/<wbr=
>isocpp.org/d/topic/sg14/<wbr>iw4Yn3kLXIg/discussion</a></div><div><a href=
=3D"https://groups.google.com/a/isocpp.org/d/topic/sg14/37sA73EJnRc/discuss=
ion" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/topic/=
sg14/<wbr>37sA73EJnRc/discussion</a></div><div>Regards,</div><div>John</div=
></div></div><span class=3D"">

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5WXPYazGqa6R5ba%3DLMRi%3DOFr=
eq%3D4TJYW-V3AbHkM0A%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Df=
ooter" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/msgi=
d/std-<wbr>proposals/<wbr>CABPJVnTh5WXPYazGqa6R5ba%<wbr>3DLMRi%3DOFreq%3D4T=
JYW-<wbr>V3AbHkM0A%40mail.gmail.com</a>.<br>
</blockquote></div><br></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCNcNTutwc_Uc2jPgX1qSvHpD7cLAV=
5QKqrCxzReNE4bxQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCNcNTut=
wc_Uc2jPgX1qSvHpD7cLAV5QKqrCxzReNE4bxQ%40mail.gmail.com</a>.<br />

--0000000000009935f5057391c086--

.


Author: Alexander Brook Perry <alex@alexgeek.co.uk>
Date: Thu, 16 Aug 2018 16:04:27 -0700 (PDT)
Raw View
------=_Part_599_96656486.1534460667215
Content-Type: multipart/alternative;
 boundary="----=_Part_600_1965258590.1534460667216"

------=_Part_600_1965258590.1534460667216
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks all for the responses.=20

I think what it boils down to is that we fundamentally can't represent the=
=20
relationship between the SoA containers and the individual members of the=
=20
structure.

In your implementation Jake and in others I have seen you still at some=20
point need to manually map them with an index:

constexpr static size_t c_max =3D 0;

My concern is that this is then a very manual and error-prone process to=20
alter the structures and refactoring tools would not be able to help.

I'm not up to speed on the current proposals for reflection. The last I=20
heard there were competing ideologies for it?

Would anyone be able to share what this would look like in the future with=
=20
reflection support? =20

On Thursday, 16 August 2018 19:38:44 UTC+1, Jake Arkinstall wrote:
>
> This=20
> <https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAKxAEZSAbA=
QwDtRkBSAJgCFufSAZ1QBXYskwgA5NwDMeFsgYisAag6yAwgREAHBpg3YOABgCCchUpWZ1WgG6Z=
kRYkdMWu8xcrUbNAMxFFAjxUFiYGN3NLbxs7TREQhkIATyiLc3CAW0xBXSYJVR19TAB9RLwGQQ4=
Adj5zVUbVbNz8wrws/Vr6sya%2BosxO5gJDLQIU3UwW1QAVUiKJqaYc1QAxecE8AC8yggA6A9UA=
SWrZYwb%2BxrQWQRGAD11iVSZE1FUspl0Ia9vZ7gA2IrzH4ENYA1T%2BDYEdAgEAKLB3UqCTAAR=
xEUwkfhOBz2RgAlN13JdLsRMDpiCxVLcYSAPgBrXZ6AwQInEtnU2EKeyoBkQSFU6Gw4BkrGnbAQ=
Ah4vE41lsxoE2Q9Nm1AAi7ll/RGQyYIz8mx2pVBR3m40m03WCzNy0wONmYo1fRBmAeT25eHQEKC=
yG%2BYV%2Bq3B/Jm1S4/1tBEEBLqDuJHLhLG5vP5seFBCxRglEZxCqVcsaeH8qidLogRzs2FUJk=
jOdzfUCiixqgAtKpaOn%2BeGsxpq3LVdHGr2LpctfodaNtIsWrag%2Bk2UXHlTtrtVAoWJhiEjF=
xAq33%2BqTyZTY8UDBuDfY/Du2aalitD0yypgDDkWKmtCYoTSj2OgzKzkZYVeLyaNxFR3AcMl6Y=
lh2GMd9SXY1LWvWwLSvaYZhnYk51dVB3QhEhMAKBAIDQkMgULX1QX9Ej/G3Qc5VjLkeUwPl3yFE=
UtCOdNJWzQC8wLTCSzLCsaIgmsmn8PCCIbZtWzOCV5morsePUGo1VovowPUlSNSg0dzzUpoUOtW=
YTQnIz1h3Qy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xB7VC0Q1F9TuHggT5T42HFqY=
7mYRK17pLCG2pp7Pj%2BAshcBcDtGFjUEbTcBBLoDzB35T7AnoDBKaAsDcBcDzAIDTrUEIl7B36=
gYUpwqrHrYnRSD4qTRSBBJSCkAsDSAmBEmoDSCaD8D8ASxiCFByC0BEkECkm4n4p0ggD/AAAsew=
QSsgNQIYsgAAHFwEEiYf8EEowNIJyUSSSVIGSaQBSVIESb4m%2BMyXKbiaQHALADAIgCgKgJ0JU=
GuOQJQGgAaQYMQISsKaQOoXGmuL4hABzCyaQBzAoIwikNIIyaQKaU%2BAQAAPIsAMDunqmkBYAf=
BsAGBOn4CkjOD2q5BOnOhOCJCSBSCelr4PhOkSIdAekanMBsAoDUm8CMB4Acy%2BKQD4pWIhC%2=
BjSCNjUhmycB9I8C0A1BNi%2BmenCB0mSC0B4nSCEnElOmKl3CCn/CNhcmqDADICX6Cl7BcCqAQ=
C4CEAkC9KyD0CqCaD6m6CGlPAMnrRUkNlMkskUHsmyBBJ7Ccn/BcA1CyD/BNmckTGyC3kSn4nSm=
kBZAgCcncnGG0DLlcBjFpFcCCnvk1B9nBmKnKkgCqkHmak6kQBICiAEB8xJQUA%2BhmlrggDwla=
ELkWn0DRxRy6DZndkEkyn9nCyeDwlqlkkUEQpMBYAWlbiSlSDPmvm/GnninHl8lBL/BCm/EmBAW=
ynymgVCDgWkDkUalam6lwUIXGnIUbnml0CkAYUuByU4WfD4X0W9l8XknSAMmqDRyEAT6DnDmjnj=
mTnTn7nqkUFPlEmvmyCyB7A2X2UOWOXAX8XSBgUQXmVskgDHksUXlXk3l3kPn0WyBEUgWuXCUHk=
EVcAhUuVKnhUeWkCsybBhBvlAA%3D%3D%3D>=20
> is an example of what can be done right now, based on the approach I=20
> described above.
>
> I've included a demonstration on iterating through a single column,=20
> followed by iterating through structs.
>
> Health warning (pun unintended): the boilerplate isn't pretty, but the=20
> modifications to Health aren't so bad. On the upside, GCC digests it pret=
ty=20
> well with -O1. The equivalent for the AoS has fewer=20
> <https://godbolt.org/g/j2bSBj> instructions, but the SoA performance is=
=20
> noticably better <http://quick-bench.com/AShU4NH6p0ulFD1oAsGCmR8FIZs>=20
> (boilerplate ends at line 200) for column-based operations (because of cp=
u=20
> cache) when the struct contains more than just two ints.
>
> It isn't very useful in it's current form (looping through e.g. N struct=
=20
> variables out of many would be a nice addition), but it's easy enough to=
=20
> use.
>
> On Thu, Aug 16, 2018 at 11:55 AM, John McFarlane <jo...@mcfarlane.name=20
> <javascript:>> wrote:
>
>> On Thu, 16 Aug 2018 at 00:42 Alexander Brook Perry <al...@alexgeek.co.uk=
=20
>> <javascript:>> wrote:
>>
>>> Hey,
>>>
>>> Does anyone know if there are any existing proposals to standardise=20
>>> using Structures of Arrays (SoA) over Arrays of Structures (AoS)?=20
>>>
>>> I've seen a lot of advocacy for the SoA approach in gameplay and=20
>>> graphics programming but it doesn't seem to fit in with the core langua=
ge=20
>>> without typing error prone boilerplate.
>>>
>>
>> SoA is raised in SG14 from time to time, e.g.:
>> https://groups.google.com/a/isocpp.org/d/topic/sg14/iw4Yn3kLXIg/discussi=
on
>> https://groups.google.com/a/isocpp.org/d/topic/sg14/37sA73EJnRc/discussi=
on
>> Regards,
>> John
>>
>> --=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit=20
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5W=
XPYazGqa6R5ba%3DLMRi%3DOFreq%3D4TJYW-V3AbHkM0A%40mail.gmail.com=20
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5=
WXPYazGqa6R5ba%3DLMRi%3DOFreq%3D4TJYW-V3AbHkM0A%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
>> .
>>
>
>

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/e40c2b53-8802-432d-bff5-bef01a717fd9%40isocpp.or=
g.

------=_Part_600_1965258590.1534460667216
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks all for the responses.=C2=A0<div><br></div><div>I t=
hink what it boils down to is that we fundamentally can&#39;t represent the=
 relationship between the SoA containers and the individual members of the =
structure.</div><div><br></div><div>In your implementation Jake and in othe=
rs I have seen you still at some point need to manually map them with an in=
dex:</div><div><br></div><div><div style=3D"color: #000000;background-color=
: #fffffe;font-family: Consolas, " liberation=3D"" mono",=3D"" courier,=3D"=
" monospace;font-weight:=3D"" normal;font-size:=3D"" 14px;line-height:=3D""=
 19px;white-space:=3D"" pre;"=3D""><span style=3D"color: #0000ff;">constexp=
r</span> <span style=3D"color: #0000ff;">static</span> size_t c_max =3D <sp=
an style=3D"color: #09885a;">0</span>;</div></div><div><br></div><div>My co=
ncern is that this is then a very manual and error-prone process to alter t=
he structures and refactoring tools would not be able to help.</div><div><b=
r></div><div>I&#39;m not up to speed on the current proposals for reflectio=
n. The last I heard there were competing ideologies for it?</div><div><br><=
/div><div>Would anyone be able to share what this would look like in the fu=
ture with reflection support?=C2=A0=C2=A0</div><div><div><br>On Thursday, 1=
6 August 2018 19:38:44 UTC+1, Jake Arkinstall  wrote:<blockquote class=3D"g=
mail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc sol=
id;padding-left: 1ex;"><div dir=3D"ltr"><div><div><a href=3D"https://godbol=
t.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAKxAEZSAbAQwDtRkBSAJgCFufSA=
Z1QBXYskwgA5NwDMeFsgYisAag6yAw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KQD4pWIhC%252BjSCNjUhmycB9I8C0A1BNi%252BmenCB0mSC0B4nS=
CEnElOmKl3CCn%2FCNhcmqDADICX6Cl7BcCqAQC4CEAkC9KyD0CqCaD6m6CGlPAMnrRUkNlMksk=
UHsmyBBJ7Ccn%2FBcA1CyD%2FBNmckTGyC3kSn4nSmkBZAgCcncnGG0DLlcBjFpFcCCnvk1B9nB=
mKnKkgCqkHmak6kQBICiAEB8xJQUA%252BhmlrggDwlaELkWn0DRxRy6DZndkEkyn9nCyeDwlql=
kkUEQpMBYAWlbiSlSDPmvm%2FGnninHl8lBL%2FBCm%2FEmBAWynymgVCDgWkDkUalam6lwUIXG=
nIUbnml0CkAYUuByU4WfD4X0W9l8XknSAMmqDRyEAT6DnDmjnjmTnTn7nqkUFPlEmvmyCyB7A2X=
2UOWOXAX8XSBgUQXmVskgDHksUXlXk3l3kPn0WyBEUgWuXCUHkEVcAhUuVKnhUeWkCsybBhBvlA=
A%253D%253D%253D\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEKImC2DX2tfEA1Vbca=
C7lF7Vgphw&#39;;return true;" onclick=3D"this.href=3D&#39;https://www.googl=
e.com/url?q\x3dhttps%3A%2F%2Fgodbolt.org%2F%23z%3AOYLghAFBqd5QCxAYwPYBMCmBR=
dBLAF1QCcAaPECAKxAEZSAbAQwDtRkBSAJgCFufSAZ1QBXYskwgA5NwDMeFsgYisAag6yAwgREA=
HBpg3YOABgCCchUpWZ1WgG6ZkRYkdMWu8xcrUbNAMxFFAjxUFiYGN3NLbxs7TREQhkIATyiLc3C=
AW0xBXSYJVR19TAB9RLwGQQ4Adj5zVUbVbNz8wrws%2FVr6sya%252BosxO5gJDLQIU3UwW1QAV=
UiKJqaYc1QAxecE8AC8yggA6A9UASWrZYwb%252BxrQWQRGAD11iVSZE1FUspl0Ia9vZ7gA2Irz=
H4ENYA1T%252BDYEdAgEAKLB3UqCTAARxEUwkfhOBz2RgAlN13JdLsRMDpiCxVLcYSAPgBrXZ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hcmqDADICX6=
Cl7BcCqAQC4CEAkC9KyD0CqCaD6m6CGlPAMnrRUkNlMkskUHsmyBBJ7Ccn%2FBcA1CyD%2FBNmc=
kTGyC3kSn4nSmkBZAgCcncnGG0DLlcBjFpFcCCnvk1B9nBmKnKkgCqkHmak6kQBICiAEB8xJQUA=
%252BhmlrggDwlaELkWn0DRxRy6DZndkEkyn9nCyeDwlqlkkUEQpMBYAWlbiSlSDPmvm%2FGnni=
nHl8lBL%2FBCm%2FEmBAWynymgVCDgWkDkUalam6lwUIXGnIUbnml0CkAYUuByU4WfD4X0W9l8X=
knSAMmqDRyEAT6DnDmjnjmTnTn7nqkUFPlEmvmyCyB7A2X2UOWOXAX8XSBgUQXmVskgDHksUXlX=
k3l3kPn0WyBEUgWuXCUHkEVcAhUuVKnhUeWkCsybBhBvlAA%253D%253D%253D\x26sa\x3dD\x=
26sntz\x3d1\x26usg\x3dAFQjCNEKImC2DX2tfEA1VbcaC7lF7Vgphw&#39;;return true;"=
>This</a> is an example of what can be done right now, based on the approac=
h I described above.<br><br><div>I&#39;ve included a demonstration on itera=
ting through a single column, followed by iterating through structs.</div><=
br>Health warning (pun unintended): the boilerplate isn&#39;t pretty, but t=
he modifications to Health aren&#39;t so bad. On the upside, GCC digests it=
 pretty well with -O1. The equivalent for the AoS has <a href=3D"https://go=
dbolt.org/g/j2bSBj" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.=
href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgodbolt.org%2Fg%2=
Fj2bSBj\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEtZjQwBn80tIRdNfDfDv6F1P0jN=
g&#39;;return true;" onclick=3D"this.href=3D&#39;https://www.google.com/url=
?q\x3dhttps%3A%2F%2Fgodbolt.org%2Fg%2Fj2bSBj\x26sa\x3dD\x26sntz\x3d1\x26usg=
\x3dAFQjCNEtZjQwBn80tIRdNfDfDv6F1P0jNg&#39;;return true;">fewer</a> instruc=
tions, but the SoA performance is noticably <a href=3D"http://quick-bench.c=
om/AShU4NH6p0ulFD1oAsGCmR8FIZs" target=3D"_blank" rel=3D"nofollow" onmoused=
own=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fquick-b=
ench.com%2FAShU4NH6p0ulFD1oAsGCmR8FIZs\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAF=
QjCNFgen6jkcp1cj2-TTgc-83aXJkCkg&#39;;return true;" onclick=3D"this.href=3D=
&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fquick-bench.com%2FAShU4NH6=
p0ulFD1oAsGCmR8FIZs\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgen6jkcp1cj2-T=
Tgc-83aXJkCkg&#39;;return true;">better</a> (boilerplate ends at line 200) =
for column-based operations (because of cpu cache) when the struct contains=
 more than just two ints.<br><br></div><div>It isn&#39;t very useful in it&=
#39;s current form (looping through e.g. N struct variables out of many wou=
ld be a nice addition), but it&#39;s easy enough to use.<br></div></div></d=
iv><div><br><div class=3D"gmail_quote">On Thu, Aug 16, 2018 at 11:55 AM, Jo=
hn McFarlane <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank=
" gdf-obfuscated-mailto=3D"Y06FZGAZDAAJ" rel=3D"nofollow" onmousedown=3D"th=
is.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;j=
avascript:&#39;;return true;">jo...@mcfarlane.name</a>&gt;</span> wrote:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"=
><span><div dir=3D"ltr">On Thu, 16 Aug 2018 at 00:42 Alexander Brook Perry =
&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"Y06F=
ZGAZDAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&#39;=
;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true;">a=
l...@alexgeek.co.uk</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
<div dir=3D"ltr">Hey,<div><br></div><div>Does anyone know if there are any =
existing proposals to standardise using Structures of Arrays (SoA) over Arr=
ays of Structures (AoS)?=C2=A0</div><div><br></div><div>I&#39;ve seen a lot=
 of advocacy for the SoA approach in gameplay and graphics programming but =
it doesn&#39;t seem to fit in with the core language without typing error p=
rone boilerplate.</div></div></blockquote><div><br></div></span><div>SoA is=
 raised in SG14 from time to time, e.g.:</div><div><a href=3D"https://group=
s.google.com/a/isocpp.org/d/topic/sg14/iw4Yn3kLXIg/discussion" target=3D"_b=
lank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://groups.googl=
e.com/a/isocpp.org/d/topic/sg14/iw4Yn3kLXIg/discussion&#39;;return true;" o=
nclick=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/topic/s=
g14/iw4Yn3kLXIg/discussion&#39;;return true;">https://groups.google.com/a/<=
wbr>isocpp.org/d/topic/sg14/<wbr>iw4Yn3kLXIg/discussion</a></div><div><a hr=
ef=3D"https://groups.google.com/a/isocpp.org/d/topic/sg14/37sA73EJnRc/discu=
ssion" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;h=
ttps://groups.google.com/a/isocpp.org/d/topic/sg14/37sA73EJnRc/discussion&#=
39;;return true;" onclick=3D"this.href=3D&#39;https://groups.google.com/a/i=
socpp.org/d/topic/sg14/37sA73EJnRc/discussion&#39;;return true;">https://gr=
oups.google.com/a/<wbr>isocpp.org/d/topic/sg14/<wbr>37sA73EJnRc/discussion<=
/a></div><div>Regards,</div><div>John</div></div></div><span>

<p></p>

-- <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 <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
Y06FZGAZDAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"Y06FZGAZDAAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39=
;javascript:&#39;;return true;">std-pr...@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5WXPYazGqa6R5ba%3DLMRi%3DOFr=
eq%3D4TJYW-V3AbHkM0A%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Df=
ooter" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5WXPYa=
zGqa6R5ba%3DLMRi%3DOFreq%3D4TJYW-V3AbHkM0A%40mail.gmail.com?utm_medium\x3de=
mail\x26utm_source\x3dfooter&#39;;return true;" onclick=3D"this.href=3D&#39=
;https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnTh5WXP=
YazGqa6R5ba%3DLMRi%3DOFreq%3D4TJYW-V3AbHkM0A%40mail.gmail.com?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/<wbr>CABPJVnTh5WXPYazGqa6R5ba=
%<wbr>3DLMRi%3DOFreq%3D4TJYW-<wbr>V3AbHkM0A%40mail.gmail.com</a>.<br>
</blockquote></div><br></div>
</blockquote></div></div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/e40c2b53-8802-432d-bff5-bef01a717fd9%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e40c2b53-8802-432d-bff5-bef01a717fd9=
%40isocpp.org</a>.<br />

------=_Part_600_1965258590.1534460667216--

------=_Part_599_96656486.1534460667215--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Thu, 16 Aug 2018 16:34:32 -0700 (PDT)
Raw View
------=_Part_598_1882201915.1534462472817
Content-Type: multipart/alternative;
 boundary="----=_Part_599_1341206223.1534462472817"

------=_Part_599_1341206223.1534462472817
Content-Type: text/plain; charset="UTF-8"

On Thursday, August 16, 2018 at 7:04:27 PM UTC-4, Alexander Brook Perry
wrote:
>
> Thanks all for the responses.
>
> I think what it boils down to is that we fundamentally can't represent the
> relationship between the SoA containers and the individual members of the
> structure.
>
> In your implementation Jake and in others I have seen you still at some
> point need to manually map them with an index:
>
> constexpr static size_t c_max = 0;
>
> My concern is that this is then a very manual and error-prone process to
> alter the structures and refactoring tools would not be able to help.
>
> I'm not up to speed on the current proposals for reflection. The last I
> heard there were competing ideologies for it?
>
> Would anyone be able to share what this would look like in the future with
> reflection support?
>

Well, it would look essentially like what others have said: a mechanism to
take a struct, take a container, and create a new type which has a series
of those containers, as applied to the members of the struct. The code
using it can't really pretend that it's an array of structs (and that's for
the best).

What the new type would look like exactly is up in the air. Worst-case,
it'd be a tuple. Best case, it'd have named members that you can access,
perhaps with helper member functions for doing more complex things like
insertions/removals of elements looking like inserting/removing a single
struct. The latter would require more generative reflection, which is still
in the early days.

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/a04ea214-834a-4489-a745-e9da1380bfae%40isocpp.org.

------=_Part_599_1341206223.1534462472817
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, August 16, 2018 at 7:04:27 PM UTC-4, Alexande=
r Brook Perry wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">Thanks all for the responses.=C2=A0<div><br></div><div>I think wha=
t it boils down to is that we fundamentally can&#39;t represent the relatio=
nship between the SoA containers and the individual members of the structur=
e.</div><div><br></div><div>In your implementation Jake and in others I hav=
e seen you still at some point need to manually map them with an index:</di=
v><div><br></div><div><div><span style=3D"color:#0000ff">constexpr</span> <=
span style=3D"color:#0000ff">static</span> size_t c_max =3D <span style=3D"=
color:#09885a">0</span>;</div></div><div><br></div><div>My concern is that =
this is then a very manual and error-prone process to alter the structures =
and refactoring tools would not be able to help.</div><div><br></div><div>I=
&#39;m not up to speed on the current proposals for reflection. The last I =
heard there were competing ideologies for it?</div><div><br></div><div>Woul=
d anyone be able to share what this would look like in the future with refl=
ection support?<br></div></div></blockquote><div><br></div><div>Well, it wo=
uld look essentially like what others have said: a mechanism to take a stru=
ct, take a container, and create a new type which has a series of those con=
tainers, as applied to the members of the struct. The code using it can&#39=
;t really pretend that it&#39;s an array of structs (and that&#39;s for the=
 best).</div><div><br></div><div>What the new type would look like exactly =
is up in the air. Worst-case, it&#39;d be a tuple. Best case, it&#39;d have=
 named members that you can access, perhaps with helper member functions fo=
r doing more complex things like insertions/removals of elements looking li=
ke inserting/removing a single struct. The latter would require more genera=
tive reflection, which is still in the early days.</div><br></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/a04ea214-834a-4489-a745-e9da1380bfae%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a04ea214-834a-4489-a745-e9da1380bfae=
%40isocpp.org</a>.<br />

------=_Part_599_1341206223.1534462472817--

------=_Part_598_1882201915.1534462472817--

.


Author: florian.csdt@gmail.com
Date: Fri, 17 Aug 2018 01:55:59 -0700 (PDT)
Raw View
------=_Part_698_412477834.1534496159448
Content-Type: multipart/alternative;
 boundary="----=_Part_699_276953728.1534496159448"

------=_Part_699_276953728.1534496159448
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



Le vendredi 17 ao=C3=BBt 2018 01:34:32 UTC+2, Nicol Bolas a =C3=A9crit :
>
> On Thursday, August 16, 2018 at 7:04:27 PM UTC-4, Alexander Brook Perry=
=20
> wrote:
>>
>> Thanks all for the responses.=20
>>
>> I think what it boils down to is that we fundamentally can't represent=
=20
>> the relationship between the SoA containers and the individual members o=
f=20
>> the structure.
>>
>> In your implementation Jake and in others I have seen you still at some=
=20
>> point need to manually map them with an index:
>>
>> constexpr static size_t c_max =3D 0;
>>
>> My concern is that this is then a very manual and error-prone process to=
=20
>> alter the structures and refactoring tools would not be able to help.
>>
>> I'm not up to speed on the current proposals for reflection. The last I=
=20
>> heard there were competing ideologies for it?
>>
>> Would anyone be able to share what this would look like in the future=20
>> with reflection support?
>>
>
> Well, it would look essentially like what others have said: a mechanism t=
o=20
> take a struct, take a container, and create a new type which has a series=
=20
> of those containers, as applied to the members of the struct. The code=20
> using it can't really pretend that it's an array of structs (and that's f=
or=20
> the best).
>
> What the new type would look like exactly is up in the air. Worst-case,=
=20
> it'd be a tuple. Best case, it'd have named members that you can access,=
=20
> perhaps with helper member functions for doing more complex things like=
=20
> insertions/removals of elements looking like inserting/removing a single=
=20
> struct. The latter would require more generative reflection, which is sti=
ll=20
> in the early days.
>
>
I've seen a library that can handle all your last points:=20
https://gitlab.cern.ch/LHCbOpt/SOAContainer
It still need the generation from a plain struct, but there is no other way=
=20
around reflexion for this.
=20

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/3184efed-af51-4d75-a589-6c4fdf447cef%40isocpp.or=
g.

------=_Part_699_276953728.1534496159448
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>Le vendredi 17 ao=C3=BBt 2018 01:34:32 UTC+2, Nico=
l Bolas a =C3=A9crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr">On Thursday, August 16, 2018 at 7:04:27 PM UTC-4, Alexander B=
rook Perry wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin=
-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">T=
hanks all for the responses.=C2=A0<div><br></div><div>I think what it boils=
 down to is that we fundamentally can&#39;t represent the relationship betw=
een the SoA containers and the individual members of the structure.</div><d=
iv><br></div><div>In your implementation Jake and in others I have seen you=
 still at some point need to manually map them with an index:</div><div><br=
></div><div><div><span style=3D"color:#0000ff">constexpr</span> <span style=
=3D"color:#0000ff">static</span> size_t c_max =3D <span style=3D"color:#098=
85a">0</span>;</div></div><div><br></div><div>My concern is that this is th=
en a very manual and error-prone process to alter the structures and refact=
oring tools would not be able to help.</div><div><br></div><div>I&#39;m not=
 up to speed on the current proposals for reflection. The last I heard ther=
e were competing ideologies for it?</div><div><br></div><div>Would anyone b=
e able to share what this would look like in the future with reflection sup=
port?<br></div></div></blockquote><div><br></div><div>Well, it would look e=
ssentially like what others have said: a mechanism to take a struct, take a=
 container, and create a new type which has a series of those containers, a=
s applied to the members of the struct. The code using it can&#39;t really =
pretend that it&#39;s an array of structs (and that&#39;s for the best).</d=
iv><div><br></div><div>What the new type would look like exactly is up in t=
he air. Worst-case, it&#39;d be a tuple. Best case, it&#39;d have named mem=
bers that you can access, perhaps with helper member functions for doing mo=
re complex things like insertions/removals of elements looking like inserti=
ng/removing a single struct. The latter would require more generative refle=
ction, which is still in the early days.</div><br></div></blockquote><div><=
br></div><div>I&#39;ve seen a library that can handle all your last points:=
 <a href=3D"https://gitlab.cern.ch/LHCbOpt/SOAContainer">https://gitlab.cer=
n.ch/LHCbOpt/SOAContainer</a></div><div>It still need the generation from a=
 plain struct, but there is no other way around reflexion for this.<br></di=
v><div>=C2=A0</div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/3184efed-af51-4d75-a589-6c4fdf447cef%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/3184efed-af51-4d75-a589-6c4fdf447cef=
%40isocpp.org</a>.<br />

------=_Part_699_276953728.1534496159448--

------=_Part_698_412477834.1534496159448--

.