On Saturday, 7 April 2018 at 19:21:30 UTC, Simen Kjærås wrote:
import std.meta;
import std.traits;
// List all member functions, and wrap them such that
myFoo.fun(3) can be called as
AllMemberFunctions!(typeof(myFoo))[idx](myFoo, 3).
template AllMemberFunctions(T)
{
template
On Saturday, 7 April 2018 at 13:31:01 UTC, Timoses wrote:
Simen was faster :)
In my solution I simply ignore such things as functions... But
there is the cool delegate creation approach in Simen's solution
for this. I can handle arrays instead. :)
And I got rid of tupelof acting on an
On Saturday, 7 April 2018 at 13:31:01 UTC, Timoses wrote:
In the end I would like to accomplish the following:
Provide access to contained bitfields and members of a struct
in the order they
appear in the struct via an index.
The behavior of Type.tupleof in D seems a bit unfinished - they
(Please read at the very bottom what I'd like to achieve)
Is it possible to return the member of a struct by its .tupleof
index?
I know that it would work on a struct value, but I'd like it to
work on the type's tupleof:
```
struct S { int i;}
S s;
// below leads to: Error: need this for