On Saturday, 23 May 2015 at 04:40:28 UTC, tcak wrote:
[snip]
Yup, you need to use == to match the exact type.
Btw, you can use enum templates from std.traits, to accomplish
the same with less code:
public void setMarker(M)( size_t markerIndex, M markerValue )
if(isScalarType!M)
{
On Sunday, 24 May 2015 at 14:46:52 UTC, ZombineDev wrote:
[snip]
Correction: not exactly the same, because isScalar also allows
wchar, dchar and const and immutable versions of those 'scalar'
types.
[code]
import std.stdio;
public void setMarker(M)( size_t markerIndex, M markerValue )
if(
is(M: ulong) || is(M: long) ||
is(M: uint) || is(M: int) ||
is(M: ushort) || is(M: short) ||
is(M: ubyte) || is(M: byte) || is(M:
On Saturday, 23 May 2015 at 04:35:55 UTC, tcak wrote:
[code]
import std.stdio;
public void setMarker(M)( size_t markerIndex, M markerValue )
if(
is(M: ulong) || is(M: long) ||
is(M: uint) || is(M: int) ||
is(M: ushort) || is(M: short) ||