On Friday, 14 April 2017 at 17:57:49 UTC, Johannes Pfau wrote:
Am Fri, 14 Apr 2017 13:41:45 +
schrieb Moritz Maxeiner :
[...]
Great, thanks that's exactly the solution I wanted. Figuring
this out by myself is a bit above my template skill level ;-)
-- Johannes
Am Fri, 14 Apr 2017 13:41:45 +
schrieb Moritz Maxeiner :
> On Friday, 14 April 2017 at 11:29:03 UTC, Johannes Pfau wrote:
> >
> > Is there some way to wrap the 'type selection'? In pseudo-code
> > something like this:
> >
> > enum FilteredOverloads(API) = ...
> >
> >
On Friday, 14 April 2017 at 11:29:03 UTC, Johannes Pfau wrote:
Is there some way to wrap the 'type selection'? In pseudo-code
something like this:
enum FilteredOverloads(API) = ...
foreach(Overload, FilteredOverloads!API)
{
}
Sure, but that's a bit more complex:
---
[...] //
Am Fri, 14 Apr 2017 08:55:48 +
schrieb Moritz Maxeiner :
>
> mixin Foo!(API, (MethodType) {
> // function dependent code here
> });
> foo();
> ---
>
> Option 2: Code generation using CTFE
>
> ---
> string genFoo(alias API, string justDoIt)
> {
> import std.array :
On Friday, 14 April 2017 at 08:24:00 UTC, Johannes Pfau wrote:
I've got this code duplicated in quite some functions:
-
[...]1
foreach (MethodType; overloads)
{
// function dependent code here
}
[...]2
On Friday, 14 April 2017 at 08:24:00 UTC, Johannes Pfau wrote:
I've got this code duplicated in quite some functions:
-
foreach (member; __traits(derivedMembers, API))
{
// Guards against private members
static if (__traits(compiles, __traits(getMember, API,
I've got this code duplicated in quite some functions:
-
foreach (member; __traits(derivedMembers, API))
{
// Guards against private members
static if (__traits(compiles, __traits(getMember, API, member)))
{
static if (isSomeFunction!(__traits(getMember,