On Tuesday, November 04, 2014 07:19:03 Algo via Digitalmars-d-learn wrote:
> Is it possible?
> As in
> {
> int a;
> a.opUnary!"++"();
> }
> no property 'opUnary' for type 'int'
opUnary only exists when it's been declared on a user-defined type. The way
to use it generically is to use t
On Tuesday, 4 November 2014 at 07:49:15 UTC, Rikki Cattermole
wrote:
On 4/11/2014 8:19 p.m., Algo wrote:
Is it possible?
As in
{
int a;
a.opUnary!"++"();
}
no property 'opUnary' for type 'int'
For primitives it doesn't look like it.
To confirm this, we'll first figure out what TypeI
On Tuesday, 4 November 2014 at 07:19:05 UTC, Algo wrote:
Is it possible?
As in
{
int a;
a.opUnary!"++"();
}
no property 'opUnary' for type 'int'
((ref typeof(a) x) => ++x)(a);
works
On 4/11/2014 8:19 p.m., Algo wrote:
Is it possible?
As in
{
int a;
a.opUnary!"++"();
}
no property 'opUnary' for type 'int'
For primitives it doesn't look like it.
To confirm this, we'll first figure out what TypeInfo is used for it:
pragma(msg, typeid(int).name);
/d133/f260.d(16)
Is it possible?
As in
{
int a;
a.opUnary!"++"();
}
no property 'opUnary' for type 'int'