Re: Injecting code into methods based on UDA's

2013-10-20 Thread Dicebot
On Sunday, 20 October 2013 at 11:58:41 UTC, TheFlyingFiddle wrote: It's only possible to inject code using a template or string mixin. Ah, too bad. Thanks for the answer. Well, it is possible to do it if you use some kind of own framework for declarative stuff and call the function only from

Re: Injecting code into methods based on UDA's

2013-10-20 Thread TheFlyingFiddle
It's only possible to inject code using a template or string mixin. Ah, too bad. Thanks for the answer.

Re: Injecting code into methods based on UDA's

2013-10-20 Thread Jacob Carlborg
On 2013-10-20 01:16, TheFlyingFiddle wrote: Is it possible to inject code into a method with UDA's? For example if i wanted a method to do some logging when it's called. It's only possible to inject code using a template or string mixin. -- /Jacob Carlborg

Re: Injecting code into methods based on UDA's

2013-10-19 Thread TheFlyingFiddle
Is it possible to inject code into a method with UDA's? For example if i wanted a method to do some logging when it's called. Something like the following. void logMsg(string file, string msg) { //Log the message to the file. } struct Log { string logFile; } class Foo { void bar() { /*

Re: Injecting code into methods based on UDA's

2013-10-19 Thread TheFlyingFiddle
Sry accedentaly clicked send while writing..

Injecting code into methods based on UDA's

2013-10-19 Thread TheFlyingFiddle
void logMsg(string file, string msg) { //Log the message to the file. } struct Log { string logFile; LogInfo toLog; } class Foo { void bar() { /* do something */ } @Log("fooInfo.txt", LogInfo.methodCall | LogInfo.returnValue) void baz() { //Doess } }