Hi,
What is the best way to write a class proxy ?
I need to intercept attribute access.
Example:
The user write a PODO:
class User
{
string name;
}
Then he use my library:
auto user = mylib.get!User(); // return a proxy here
writeln(user.name); // intercept user.name access (how to do
On Tuesday, 19 March 2019 at 23:41:58 UTC, Steven Schveighoffer
wrote:
On 3/19/19 7:22 PM, Bastiaan Veelo wrote:
Beware that a CT AA stores its elements in a different order
than a RT AA, which you would notice in a foreach, for example.
Yes, this is the issue -- the runtime AA depends on
Hi,
I want to use a constant associative array in a ctfe-able
function.
Example:
string ctfeableFunction()
{
return Foo["foo"];
}
Then I force ctfe with:
enum res = ctfeableFunction();
When I use an enum like:
enum Foo = ["foo" : "bar"];
It works fine.
D-Scanner keep saying to me:
Hi,
AutoMapper is an object-object mapper.
It use compile-time generated mapper to try to avoid any overhead.
I'm posting in this section, because I'm not a D expert and any
feedback will be appreciated :)
Have a look:
https://github.com/boolangery/d-automapper
Hi,
Is something like this is doable ?
---
// all compile time
MapperGen.Create!(A, B)
.Map!("p1", "p2")
.Map!("myprop", "otherprop")
.Gen();
// The code above must generate something like
//
// class Mapper {
// B
Hi,
I want to do something like that:
The user first register some type associated to a string and a
callback
registerHandler!Foo("foo", (res) {
info("message received");
});
I want the callback to be called when a json packet containing
the string "foo" arrives on a transport layer.