On 08/31/2015 08:55 PM, WhatMeWorry wrote:
> Thanks for all the above suggestions, but after many hour of re-reading
> Ali's book on template, structs, and mixins, I still in the woods. I've
> tried two approaches:
>
> Templatetized struct
>
> st
Thanks for all the above suggestions, but after many hour of
re-reading Ali's book on template, structs, and mixins, I still
in the woods. I've tried two approaches:
Templatetized struct
struct Chameleon(T, Purpose p)
{
static if (p == P
On Monday, 31 August 2015 at 05:38:54 UTC, Jonathan M Davis wrote:
So, you're going to need to pass it a Chameleon!(float,
purpose.POSITIONAL) and a Chameleon!(float, purpose.COLOR_ONLY
color), not 6 doubles - either that, or you're going to need to
declare a constructor for VertexData which ta
On Monday, 31 August 2015 at 05:47:31 UTC, Ali Çehreli wrote:
On 08/30/2015 10:38 PM, Jonathan M Davis via
Digitalmars-d-learn wrote:
On Monday, August 31, 2015 04:57:05 WhatMeWorry via
Digitalmars-d-learn wrote:
This seemingly trivial array initialization has caused me
hours
of grief.
enum
On 08/30/2015 10:38 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Monday, August 31, 2015 04:57:05 WhatMeWorry via Digitalmars-d-learn wrote:
This seemingly trivial array initialization has caused me hours
of grief.
enum Purpose { POSITIONAL, COLOR_ONLY, COLOR_AND_ALPHA,
GENERIC_TRIPL
On Monday, August 31, 2015 04:57:05 WhatMeWorry via Digitalmars-d-learn wrote:
>
> This seemingly trivial array initialization has caused me hours
> of grief.
>
> enum Purpose { POSITIONAL, COLOR_ONLY, COLOR_AND_ALPHA,
> GENERIC_TRIPLE, GENERIC_QUAD }
> Purpose purpose;
>
> struct Chameleon(T, Purp
This seemingly trivial array initialization has caused me hours
of grief.
enum Purpose { POSITIONAL, COLOR_ONLY, COLOR_AND_ALPHA,
GENERIC_TRIPLE, GENERIC_QUAD }
Purpose purpose;
struct Chameleon(T, Purpose p) // template
{
static if (is (p == POSITIONAL)) {
T x, y, z;
} el