On 7/22/22 2:34 PM, Ben Jones wrote:
Can you elaborate on why it's probably OK in practice?
Because the GC deals with interior pointers just fine. Blocks with the
"no interior" bit set are very rare, and for only specialized use, so
normally this should not be a problem.
I have argued in
On 7/22/22 3:22 PM, Azi Hassan wrote:
Oh, interesting syntax. I was thinking something along the lines of
```D
template printEnum(...) {
version(debug) {
... // everything we already did
} else {
enum printEnum(alias x) = x;
}
}
```
But I like yours better.
`
On Wednesday, 20 July 2022 at 14:11:52 UTC, Dennis wrote:
On Wednesday, 20 July 2022 at 00:33:06 UTC, Azi Hassan wrote:
Where did you find it though ? I checked dmd --help and man
dmd before making this thread, but to no avail.
It was implemented as an internal debugging tool, not a
documente
On Wednesday, 20 July 2022 at 01:15:44 UTC, Steven Schveighoffer
wrote:
On 7/19/22 8:57 PM, Steven Schveighoffer wrote:
There's a slight bloat in the compiler symbol table when but
other than that it should be effective.
Obviously I didn't finish that thought...
"when `-debug` isn't used on
On Friday, 22 July 2022 at 16:57:21 UTC, Steven Schveighoffer
wrote:
It's specifically undefined behavior by the spec, but in
practice, I think it will work, as long as the block you have
isn't marked as not allowing interior pointers.
See: https://dlang.org/spec/garbage.html#pointers_and_gc
On Fri, Jul 22, 2022 at 04:50:44PM +, Ben Jones via Digitalmars-d-learn
wrote:
> I'm looking to store a pointer to one of 2 unrelated (no inheritance
> relationship) classes and use the LSb to track which type I have. Is
> this going to cause any problems with the GC? For one of the classes
On 7/22/22 12:50 PM, Ben Jones wrote:
I'm looking to store a pointer to one of 2 unrelated (no inheritance
relationship) classes and use the LSb to track which type I have. Is
this going to cause any problems with the GC? For one of the classes
I'll have a "pointer" to 1 byte past the start of
I'm looking to store a pointer to one of 2 unrelated (no
inheritance relationship) classes and use the LSb to track which
type I have. Is this going to cause any problems with the GC?
For one of the classes I'll have a "pointer" to 1 byte past the
start of the object. It seems like std.bitma
On Friday, 22 July 2022 at 12:33:37 UTC, Anthony Quizon wrote:
I get:
```
foo.d(16): Error: mixin `foo.B.opBi!(B, ["+":function (B a, B
b) pure nothrow @nogc @safe => a])` does not match template
declaration `opBi(A, A function(A, A)[string] f0)`
```
Is this a bug or am I doing something wron
On Friday, 22 July 2022 at 12:56:44 UTC, Adam D Ruppe wrote:
```
mixin template opBi(
alias f0
) {
static foreach (k, f; f0) { typeof(this) opBinary(string op:
k)(typeof(this) r) { return f(this, r); } }
}
```
Thanks, this seems to do the trick.
On 7/22/22 8:33 AM, Anthony Quizon wrote:
Hello,
I'm trying to create a mixin for quick binary operator overloads by
passing in types with a corresponding associative array of strings to
functions. However,
the code I currently have:
```
module foo;
mixin template opBi(
A, A function(A
On Friday, 22 July 2022 at 12:33:37 UTC, Anthony Quizon wrote:
Is this a bug or am I doing something wrong?
I think this is a bug. The compiler must not take well to this
pattern, maybe the assoc array template argument, but idk. It
looks like the first type used gets cached and reused even i
Hello everyone,
I recently seen that vibe.d can't connect to a mongo replica set
and it looks that is a missing feature in the library:
https://github.com/vibe-d/vibe.d/blob/7604eea772b1a733f7bfd16591ddc5bd37850bd9/mongodb/vibe/db/mongo/connection.d#L152
Does anyone uses vibe.d with a replica
Hello,
I'm trying to create a mixin for quick binary operator overloads
by passing in types with a corresponding associative array of
strings to functions. However,
the code I currently have:
```
module foo;
mixin template opBi(
A, A function(A, A)[string] f0,
) {
static foreach (k,
On Friday, 22 July 2022 at 05:17:49 UTC, anonymouse wrote:
On Wednesday, 20 July 2022 at 09:18:29 UTC, anonymouse wrote:
As for task 3, while I understand the concept of transposing a
matrix, I'm not sure how to even begin.
By not knowing how to begin, I mean that I don't know how to
gene
15 matches
Mail list logo