Re: isCallable is not an expression

2014-09-25 Thread andre via Digitalmars-d-learn
Thanks a lot. Kind regards André

isCallable is not an expression

2014-09-24 Thread andre via Digitalmars-d-learn
Hi, following code throws an error when I uncomment method getPropertyDuplicate. getPropertyDuplicate is just a copy of getProperty except the method name. Why these errors are thrown? C:\D\dmd2\windows\bin\..\..\src\phobos\std\traits.d(1257): Error: isCallable!(ge tPropertyDuplicate) is

Re: isCallable is not an expression

2014-09-24 Thread Ali Çehreli via Digitalmars-d-learn
On 09/24/2014 01:11 AM, andre wrote: static if (isSomeFunction!(__traits(getMember, typeof(this), m)) Submitted the following bug report: https://issues.dlang.org/show_bug.cgi?id=13528 import std.traits; mixin template MyTemplate() { void foo() { pragma(msg,

Re: isCallable is not an expression

2014-09-24 Thread Ali Çehreli via Digitalmars-d-learn
On 09/24/2014 01:11 AM, andre wrote: template MyTemplate() { import std.traits : isSomeFunction, functionAttributes, FunctionAttribute, ReturnType; string[] getPropertyNames() 1) You need a this template parameter: string[] getPropertyNames(this MyType)() 2) Now, replace