On Monday, 11 May 2020 at 02:34:32 UTC, Adam D. Ruppe wrote:
On Monday, 11 May 2020 at 02:25:39 UTC, Heromyth wrote:
I want to get the UDAs for for a function parameter. Here the
test code and I got some errors:
I think my blog aside is one of the few if only write-ups on
how to do this:
ht
On Monday, 11 May 2020 at 02:25:39 UTC, Heromyth wrote:
I want to get the UDAs for for a function parameter. Here the
test code and I got some errors:
I think my blog aside is one of the few if only write-ups on how
to do this:
http://dpldocs.info/this-week-in-d/Blog.Posted_2019_02_11.html#h
I want to get the UDAs for for a function parameter. Here the
test code and I got some errors:
source/app.d(29,33): Error: first argument is not a symbol
source/app.d(39,15): Error: template instance app.test!(ClassA)
error instantiating
How can I fix this? Would this be a bug? Thanks.
=
Given the code:
```
auto foo(alias A, string str)()
{
// do stuff
}
struct Bar
{
// members
}
Bar bar;
bar.foo!"hello"; // This is an error. Would have to do foo!(bar,
"hello")
```
Assuming that I haven't misunderstood or borked something, having
UFCS for function templates whose pa
On Sunday, 10 May 2020 at 10:02:18 UTC, Adnan wrote:
In my naive implementation of edit-distance finder, I have to
check whether the last characters of two strings match:
ulong editDistance(const string a, const string b) {
if (a.length == 0)
return b.length;
if (b.length ==
On 10.05.20 12:02, Adnan wrote:
ulong editDistance(const string a, const string b) {
if (a.length == 0)
return b.length;
if (b.length == 0)
return a.length;
const auto delt = a[$ - 1] == b[$ - 1] ? 0 : 1;
import std.algorithm : min;
return min(
In my naive implementation of edit-distance finder, I have to
check whether the last characters of two strings match:
ulong editDistance(const string a, const string b) {
if (a.length == 0)
return b.length;
if (b.length == 0)
return a.length;
const auto delt = a[
On Sunday, 10 May 2020 at 01:15:58 UTC, Anonymouse wrote:
On Sunday, 10 May 2020 at 00:33:07 UTC, NaN wrote:
Ie something like..
auto Foo(T)(auto ref T x)
{
static if (isByRef(x))
{
}
else
{
}
}
__traits(isRef, x)
Thanks :)