On Thursday, 1 April 2021 at 19:38:39 UTC, H. S. Teoh wrote:
On Thu, Apr 01, 2021 at 04:52:17PM +, Nestor via
Digitalmars-d-learn wrote: [...]
[...]
Since the length of the array is already known beforehand, you
could get significant speedups by preallocating the array:
[...]
Firs
On 4/1/21 9:01 PM, H. S. Teoh wrote:
> 6) (Not described in the thread, but applied later) Reduce GC load even
> further by reusing an array that was being allocated per iteration in
> an inner loop before.
For those who prefer a video description with some accent :) here is how
to appl
```d
shared TT[] a;
T processArray(T)(ref T[] p){/*...*/} //function calls .reserve
on its parameter
a.processArray;
```
Template *name* cannot deduce function from argument types
!()(shared(T[]))...
Even if the function is changed to only accept shared parameters,
.reserve does not appear t
On Friday, 2 April 2021 at 12:47:35 UTC, z wrote:
```d
T processArray(T)(ref T[] p){/*...*/} //function calls .reserve
```
i meant `void` for the function return type.
02.04.2021 15:06, Ali Çehreli пишет:
For those who prefer a video description with some accent :) here is how
What about accent - I'm curious what would you say about this old
Russian sketch about English and its dialects (in English, no facebook
account required):
https://www.facebook.co
On Friday, 2 April 2021 at 05:39:26 UTC, mw wrote:
Finally, I'm using:
https://run.dlang.io/is/651lT6
string t = text("head-", s[].until('\0').array, "-tail");
FYI, you don't need the call to `.array` there--`text` accepts
input ranges.
On Friday, 2 April 2021 at 05:02:52 UTC, mw wrote:
On Friday, 2 April 2021 at 04:54:07 UTC, Computermatronic wrote:
On Friday, 2 April 2021 at 04:49:22 UTC, mw wrote:
So you mean inside the writeln() call, the 0s are skipped?
Well, if I use `string t` as filename, it will try to looking
for a
On Friday, 2 April 2021 at 15:01:07 UTC, mw wrote:
BTW, shall I log a writeln() improvement bug ?
It's really confusing, e.g as debug print or logs.
In my opinion this isn't a bug. The nulls are actually printed:
```
$> rdmd test.d | hd
61 62 63 00 00 00 36 0a 68 65 61 64 2d 61 62
On Thursday, 1 April 2021 at 22:35:01 UTC, tsbockman wrote:
Suppose I have a templated struct member function for which I
can compute at compile-time when the function is memory safe,
and when it is not. But, the compiler cannot correctly
determine this automatically.
Compiler should be able
On Friday, 2 April 2021 at 12:47:35 UTC, z wrote:
Even if the function is changed to only accept `shared`
parameters, `.reserve` does not appear to support `shared` so
the function is impossible to use without somehow changing its
type or using `__gshared`.
There is no way that `.reserve` can
On Thursday, 4 March 2021 at 13:47:11 UTC, Imperatorn wrote:
On Monday, 1 March 2021 at 22:25:39 UTC, Rey Valeza wrote:
Hi, I wrote a tutorial on Vibe.d while trying to re-learn
Vibe.d. I find that most of Kai Nacke's book need updating, so
I wrote a tutorial while trying to re-learn it.
Here
I have an attribute scope:
```
@PublicApi {
// ...
}
```
Querying with hasUDA! works as expected.
Later, I added a property to PublicApi:
```
struct PublicApi {
bool exposeDetails;
}
```
And want to ask the compiler via getUDAs! about the boolean but
this fails with:
```Error: type Publ
"Whether the attributes are values or types is up to the user, and
whether later attributes accumulate or override earlier ones is also up
to how the user interprets them."
This doesn't explain it well, but you were adding types as attributes on
to those symbols. Not struct instances.
On Saturday, 3 April 2021 at 04:03:14 UTC, rikki cattermole wrote:
This doesn't explain it well, but you were adding types as
attributes on to those symbols. Not struct instances.
omg - that's dumb - I was thinking the compiler whould be aware
of that.
So, I need to check for isType! first,
14 matches
Mail list logo