I have a template that is suppose to create a type based on a
template parameter
static if (T == "int")
{
auto x = New!int();
}
else static if (T == "double")
{
auto x = New!double();
}
x = 1.234;
This is just an example, I use custom types.
The static if's prevent x's scope from being
On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine wrote:
I feel that in this case I feel that the scope of the static if
should allow things to escape since, well, they are static if's.
They do.
What, exactly, did you do and what, exactly did you see as the
error?
On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine wrote:
I have a template that is suppose to create a type based on a
template parameter
static if (T == "int")
{
auto x = New!int();
}
else static if (T == "double")
{
auto x = New!double();
}
x = 1.234;
This is just an example,
On Friday, 19 August 2016 at 01:25:10 UTC, Anonymouse wrote:
On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine wrote:
I have a template that is suppose to create a type based on a
template parameter
static if (T == "int")
{
auto x = New!int();
}
else static if (T == "double")
{
a
On Friday, 19 August 2016 at 01:18:28 UTC, Adam D. Ruppe wrote:
On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine wrote:
I feel that in this case I feel that the scope of the static
if should allow things to escape since, well, they are static
if's.
They do.
What, exactly, did you d
On Friday, 19 August 2016 at 01:53:22 UTC, Engine Machine wrote:
On Friday, 19 August 2016 at 01:25:10 UTC, Anonymouse wrote:
On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine
x = 1.234;
Ok, well, I guess the error comes from something else.
*x = 1.234 for when T verifies is(T == int
On Friday, 19 August 2016 at 02:54:48 UTC, Basile B. wrote:
On Friday, 19 August 2016 at 01:53:22 UTC, Engine Machine wrote:
On Friday, 19 August 2016 at 01:25:10 UTC, Anonymouse wrote:
On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine
x = 1.234;
Ok, well, I guess the error comes from