add uda (e.g. @csvIgnore) support in std.csv?

mw mingwu at gmail.com
Tue Sep 8 04:53:26 UTC 2020


Hi,

I'm trying this example:

https://dlang.org/phobos/std_csv.html

```
struct Layout
{
     string name;
     int value;
     double other;

     @csvIgnore
     Layout* parent;  // add extra pointer
}

auto records = text.csvReader!Layout(';');
```

Right now, if we add this extra pointer, the compiler will error 
out:

https://run.dlang.io/is/EvU6Ee

/dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(223): Error: 
template std.conv.toImpl cannot deduce function from argument 
types !(Layout*)(string), candidates are:
...

I think if we can add add uda (e.g. @csvIgnore) support in 
std.csv, it will make the library more flexible to use.

Thoughts?



More information about the Digitalmars-d mailing list