I am creating a templated object that is a storehouse for a heap
object and executes their methods and returns an array of
results. With the help of a template, I want to achieve this, but
I want to assign the same attributes to the function. How can one
pass the attributes of a function to ano
On Thursday, 4 November 2021 at 01:29:57 UTC, jfondren wrote:
On Monday, 1 November 2021 at 19:56:13 UTC, pascal111 wrote:
But what if I want to use "strcpy" function to assign that new
value to the array that the problem is that the array won't
take more than its first initializing value lengt
On Thu, Nov 04, 2021 at 01:17:02PM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 11/4/21 10:36 AM, H. S. Teoh wrote:
>
> > import __stdin : myversion;
>
> Where can we learn more of that magic? :)
[...]
I kinda cheated, because I was the one who implemented dmd's stdin
feature, so
On 11/4/21 10:36 AM, H. S. Teoh wrote:
>import __stdin : myversion;
Where can we learn more of that magic? :)
Ali
On Thursday, 4 November 2021 at 18:21:06 UTC, Andrey Zherikov
wrote:
On Thursday, 4 November 2021 at 13:03:54 UTC, Paul Backus wrote:
Have the lambda return by reference:
```d
auto get()
{
return idx.map!(ref (i) => a[i]);
}
```
Making this example a bit complex: I want `get` to return
On Thursday, 4 November 2021 at 13:03:54 UTC, Paul Backus wrote:
On Thursday, 4 November 2021 at 11:26:30 UTC, Andrey Zherikov
wrote:
I have the following code example:
```d
struct A{}
A[5] a;
ulong[] idx = [1,3,4];
auto get()
{
return idx.map!(_ => a[_]);
}
foreach(i; 0 .. a.length)
On Thu, Nov 04, 2021 at 05:24:44PM +, Andrey Zherikov via
Digitalmars-d-learn wrote:
> On Thursday, 4 November 2021 at 17:09:31 UTC, Steven Schveighoffer wrote:
> > D doesn't have any equivalent for this.
>
> Is it possible to add this feature having `-C VERSION="1.2.3"` (`-D`
> is already us
On Thursday, 4 November 2021 at 17:09:31 UTC, Steven
Schveighoffer wrote:
D doesn't have any equivalent for this.
Is it possible to add this feature having `-C VERSION="1.2.3"`
(`-D` is already used) to be equal to `enum VERSION="1.2.3"` in
global namespace?
The closest you can get is to t
On 11/4/21 12:43 PM, Andrey Zherikov wrote:
I want to embed some info from build system - version info, for example.
I can easily do this with C++ compiler by `-DVERSION="1.2.3"` but there
is no such an option in dmd. So I'm wondering how do people workaround
this?
I see only one way: generate
I want to embed some info from build system - version info, for
example. I can easily do this with C++ compiler by
`-DVERSION="1.2.3"` but there is no such an option in dmd. So I'm
wondering how do people workaround this?
I see only one way: generate a file and add it to the build (file
might b
On Thursday, 4 November 2021 at 13:03:54 UTC, Paul Backus wrote:
Have the lambda return by reference:
```d
auto get()
{
return idx.map!(ref (i) => a[i]);
}
```
That works, thanks!
On Thursday, 4 November 2021 at 11:26:30 UTC, Andrey Zherikov
wrote:
I have the following code example:
```d
struct A{}
A[5] a;
ulong[] idx = [1,3,4];
auto get()
{
return idx.map!(_ => a[_]);
}
foreach(i; 0 .. a.length)
write(&a[i], " ");
writeln;
foreach(ref b; get())
write(&b,
I have the following code example:
```d
struct A{}
A[5] a;
ulong[] idx = [1,3,4];
auto get()
{
return idx.map!(_ => a[_]);
}
foreach(i; 0 .. a.length)
write(&a[i], " ");
writeln;
foreach(ref b; get())
write(&b, " ");
writeln;
```
How can I change `get` function so it returns the
13 matches
Mail list logo