On Friday, 3 April 2020 at 07:08:03 UTC, WebFreak001 wrote:
maybe not the optimal solution because stringof isn't properly
defined, but currently I don't think there is a better way than:
template matchesTemplateConstraints(alias fn, Args...)
{
enum def = fn.stringof;
// private void te
On Friday, 3 April 2020 at 01:03:01 UTC, Jonathan Levi wrote:
I am trying to make a templated function for any arguments
which will work for another.
Like this:
```
class Cls {
auto opBinary(string op, T)(T b)
if (__traits(compiles, opBinaryImpl!op(this, b)))
{
return opBina
I am trying to make a templated function for any arguments which
will work for another.
Like this:
```
class Cls {
auto opBinary(string op, T)(T b)
if (__traits(compiles, opBinaryImpl!op(this, b)))
{
return opBinaryImpl!op(this, b);
}
}
auto opBinaryImpl(string op, T)(Cl