On Wednesday, 6 April 2022 at 19:28:53 UTC, Steven Schveighoffer
wrote:
With `arr.find!(someLambda)`, if the lambda is using data from
outside the lambda, it needs a closure, which means it may
(probably does) allocate your needed data into a GC heap block
that will then become garbage after th
On 4/6/22 2:32 PM, Salih Dincer wrote:
On Wednesday, 6 April 2022 at 16:54:26 UTC, Steven Schveighoffer wrote:
This is almost equivalent, but it requires a lambda and an allocation.
So I'm not sure what thing you are trying to do here.
**Source Code:**
https://forum.dlang.org/post/pxkhngx
On Wednesday, 6 April 2022 at 18:21:11 UTC, Adam D Ruppe wrote:
On Wednesday, 6 April 2022 at 18:10:32 UTC, Guillaume Piolat
wrote:
Any idea how to workaround that?
Works fine if you just use the language instead of the buggy
phobos wrappers:
---
struct MyUDA
{
}
class A
On Wednesday, 6 April 2022 at 16:54:26 UTC, Steven Schveighoffer
wrote:
This is almost equivalent, but it requires a lambda and an
allocation. So I'm not sure what thing you are trying to do
here.
I tried to get these results but it didn't work:
abc
efg
h
[0, 3]
[4, 7]
[8, 9]
abcefgh
I'm
On Wednesday, 6 April 2022 at 18:10:32 UTC, Guillaume Piolat
wrote:
Any idea how to workaround that?
Works fine if you just use the language instead of the buggy
phobos wrappers:
---
struct MyUDA
{
}
class A
{
@MyUDA int a;
}
class B : A
{
@M
This program fails to build:
import std.traits: getSymbolsByUDA;
struct MyUDA
{
}
class A
{
@MyUDA int a;
}
class B : A
{
@MyUDA int b;
}
void main()
{
alias G = getSymbolsByUDA!(B, MyUDA);
}
Output:
c:\d\l
On Wednesday, 6 April 2022 at 17:33:28 UTC, Steven Schveighoffer
wrote:
As I mentioned elsewhere, it does work. But the situation I
think must be that it's only one mixin template. Probably also
you can't have any overloads in the type itself.
ooh yeah there's multiple here so the name
On 4/6/22 12:52 PM, Adam D Ruppe wrote:
On Wednesday, 6 April 2022 at 10:36:04 UTC, francesco.andreetto wrote:
Am I doing something wrong or it is impossible to use mixin templates
like that?
mixin templates can't bring in operator overloads. The spec doesn't
really say this I think, but that
On 4/6/22 6:36 AM, francesco.andreetto wrote:
I have two structs, point and vec, in which I want to implement some
arithmetic operations.
The operations are:
```
point - point = vec
point + vec = point
```
Using mixin templates the code compiles but calling the operations in
the main causes a
On 4/5/22 11:47 PM, Salih Dincer wrote:
On Tuesday, 5 April 2022 at 14:10:44 UTC, Steven Schveighoffer wrote:
[...]
I'd implement it probably like this (for D2):
```d
auto drop(T)(ref T[] arr, T which)
{
import std.algorithm, std.range;
auto f = arr.find(which);
debug if(f.empty) throw
On Wednesday, 6 April 2022 at 10:36:04 UTC, francesco.andreetto
wrote:
Am I doing something wrong or it is impossible to use mixin
templates like that?
mixin templates can't bring in operator overloads. The spec
doesn't really say this I think, but that's the way it has been
for a long time.
On Wednesday, 6 April 2022 at 10:36:04 UTC, francesco.andreetto
wrote:
I have two structs, point and vec, in which I want to implement
some arithmetic operations.
The operations are:
```
point - point = vec
point + vec = point
```
Using mixin templates the code compiles but calling the
operat
On Wednesday, 6 April 2022 at 08:55:43 UTC, BoQsc wrote:
I have a feeling that some parts of my code contains
unterminated strings and they do overflow into other string
[...]
If you suspect overflow, you can try string wrapping.
I have two structs, point and vec, in which I want to implement
some arithmetic operations.
The operations are:
```
point - point = vec
point + vec = point
```
Using mixin templates the code compiles but calling the
operations in the main causes an "incompatible type" Error:
```d
mixin templ
On Wednesday, 6 April 2022 at 08:55:43 UTC, BoQsc wrote:
I have a feeling that some parts of my code contains
unterminated strings and they do overflow into other string
that is to be combined. I'd like to take a look at strings,
analyse them manually and see if any of them end up terminated
o
On Wednesday, 6 April 2022 at 08:55:43 UTC, BoQsc wrote:
I have a feeling that some parts of my code contains
unterminated strings and they do overflow into other string
that is to be combined. I'd like to take a look at strings,
analyse them manually and see if any of them end up terminated
o
I have a feeling that some parts of my code contains unterminated
strings and they do overflow into other string that is to be
combined. I'd like to take a look at strings, analyse them
manually and see if any of them end up terminated or not.
Please provide any relevant examples of how you do
17 matches
Mail list logo