On Monday, 8 June 2020 at 06:42:44 UTC, Simen Kjærås wrote:
Arrays (technically, slices) in D are essentially this struct:
struct Array(T) {
T* ptr;
size_t length;
// operator overloads
}
So when you have int[][], each element of the outer array is an
Array!int. These, as simple s
On Monday, 8 June 2020 at 06:13:36 UTC, mw wrote:
Hi,
I have this program:
import std.stdio;
void f(ref int[] arr) {
arr ~= 3;
}
void main() {
int[][] arrs;
int[] arr;
foreach (i; 0 .. 3) {
arr
How can I initialize my two dimensional array?
When I try to run the code below I get the error:
Error: non-constant expression ["user":[cast(Capability)0],
"administrator":[cast(Capability)1]]
Code:
enum Capability {
self,
administer
}
alias Capabilities = immut
Hi,
I have this program:
import std.stdio;
void f(ref int[] arr) {
arr ~= 3;
}
void main() {
int[][] arrs;
int[] arr;
foreach (i; 0 .. 3) {
arr = new int[0];
arrs ~= arr; //(a) [
On Monday, 8 June 2020 at 02:55:25 UTC, jmh530 wrote:
In the code below, foo!fabs compiles without issue, but
foo!"fabs" does not because the import is not available in the
string mixin. If I move the import to the top of the module,
then it works. However, then if I move foo to another module,
In the code below, foo!fabs compiles without issue, but
foo!"fabs" does not because the import is not available in the
string mixin. If I move the import to the top of the module, then
it works. However, then if I move foo to another module, then it
will no longer compile since it is in differe
On 6/7/20 10:07 PM, Stanislav Blinov wrote:
On Monday, 8 June 2020 at 00:31:10 UTC, Steven Schveighoffer wrote:
This is a bug, please file. What is likely happening is that the
template is not moving the data to the underlying C call.
That is not a bug, it's a shortcoming of garbage-collect
On Monday, 8 June 2020 at 00:31:10 UTC, Steven Schveighoffer
wrote:
This is a bug, please file. What is likely happening is that
the template is not moving the data to the underlying C call.
-Steve
That is not a bug, it's a shortcoming of garbage-collected
arrays. D arrays are not equipped
On Sunday, 7 June 2020 at 23:09:41 UTC, Jack Applegame wrote:
auto const_ua = Unique!(const NonCopyable)(move(ca)); //
error, why???
}
```
Moving *from* a const would violate const. At least, until such
time that the compiler is finally taught about move() (hopefully,
sometime this deca
On 6/7/20 7:25 PM, Jack Applegame wrote:
I think it should compile.
```
struct NonCopyable {
int a;
this(this) @disable;
}
void main() {
NonCopyable[] arr = [NonCopyable(1), NonCopyable(2)]; // ok
arr ~= NonCopyable(3); // fails
}
```
This is a bug, please file. What is li
On Sunday, 7 June 2020 at 23:09:41 UTC, Jack Applegame wrote:
const NonCopyable const_a;
auto const_ua = Unique!(const NonCopyable)(move(ca)); //
error, why???
You can't move from a const variable.
I think it should compile.
```
struct NonCopyable {
int a;
this(this) @disable;
}
void main() {
NonCopyable[] arr = [NonCopyable(1), NonCopyable(2)]; // ok
arr ~= NonCopyable(3); // fails
}
```
On Saturday, 6 June 2020 at 11:58:06 UTC, Basile B. wrote:
maybe it shouldn't but then with another message, for example
Error, cannot `void` initialize a `const` declaration.
since that makes very little sense, at least as a local
variable. (as a member, this can be initialized in a
cons
On Saturday, 6 June 2020 at 12:02:03 UTC, MoonlightSentinel wrote:
On Saturday, 6 June 2020 at 08:55:20 UTC, Jack Applegame wrote:
Should it compile?
No, moveEmplace just sees a const reference and doesn't know
that a is void-initialized.
Actually, it knows. Because moveEmplace assumes target
On Sunday, 7 June 2020 at 16:26:17 UTC, Andre Pany wrote:
On Sunday, 7 June 2020 at 15:37:27 UTC, Paul Backus wrote:
On Sunday, 7 June 2020 at 12:52:12 UTC, Andre Pany wrote:
I am not sure but $DUB is a variable which could be used in
dub descriptor file but it isn't an environment variable.
On Sunday, 7 June 2020 at 15:37:27 UTC, Paul Backus wrote:
On Sunday, 7 June 2020 at 12:52:12 UTC, Andre Pany wrote:
I am not sure but $DUB is a variable which could be used in
dub descriptor file but it isn't an environment variable.
$DUB_EXE is an environment variable.
Kind regards
Andre
On Sunday, 7 June 2020 at 12:52:12 UTC, Andre Pany wrote:
I am not sure but $DUB is a variable which could be used in dub
descriptor file but it isn't an environment variable.
$DUB_EXE is an environment variable.
Kind regards
Andre
If what you say is true, the Dub documentation needs to be
On Sunday, 7 June 2020 at 12:24:13 UTC, Russel Winder wrote:
On Sun, 2020-06-07 at 10:30 +, Basile B. via
Digitalmars-d-learn wrote: […]
What is the docker image that you use ? If it is an older
version maybe that the $DUB env variable is not yet supported
by the dub version that's install
On Sunday, 7 June 2020 at 10:06:14 UTC, Russel Winder wrote:
On Sun, 2020-06-07 at 10:24 +0100, Russel Winder wrote:
Hi,
Why on earth is Dub sending out this error message (Invalid
variable: DUB)
on
GitLab but not on Travis-CI or locally?
OK, that was slightly rhetorical, more reasonably, wh
On Sunday, 7 June 2020 at 11:21:03 UTC, Jacob Carlborg wrote:
On 2020-06-07 11:24, Russel Winder wrote:
Hi,
Why on earth is Dub sending out this error message (Invalid
variable: DUB) on
GitLab but not on Travis-CI or locally?
OK, that was slightly rhetorical, more reasonably, why is dub
sen
On Sun, 2020-06-07 at 13:21 +0200, Jacob Carlborg via Digitalmars-d-learn
wrote:
> On 2020-06-07 11:24, Russel Winder wrote:
> > Hi,
> >
> > Why on earth is Dub sending out this error message (Invalid variable: DUB)
> > on
> > GitLab but not on Travis-CI or locally?
> >
> > OK, that was slightly
On Sun, 2020-06-07 at 10:30 +, Basile B. via Digitalmars-d-learn wrote:
[…]
> What is the docker image that you use ? If it is an older
> version maybe that the $DUB env variable is not yet supported by
> the dub version that's installed (it exists since 2.084.0
> according to [1]).
I am u
On 2020-06-07 11:24, Russel Winder wrote:
Hi,
Why on earth is Dub sending out this error message (Invalid variable: DUB) on
GitLab but not on Travis-CI or locally?
OK, that was slightly rhetorical, more reasonably, why is dub sending out this
message at all?
Dub is supposed to make an environ
On Sunday, 7 June 2020 at 10:06:14 UTC, Russel Winder wrote:
On Sun, 2020-06-07 at 10:24 +0100, Russel Winder wrote:
Hi,
Why on earth is Dub sending out this error message (Invalid
variable: DUB)
on
GitLab but not on Travis-CI or locally?
OK, that was slightly rhetorical, more reasonably, wh
Hi,
The Travis-CI D language image for dist bionic still seems to be build on
Xenial. Is this as it should be?
--
Russel.
===
Dr Russel Winder t: +44 20 7585 2200
41 Buckmaster Roadm: +44 7770 465 077
London SW11 1EN, UK w: www.russel.org.uk
On Sun, 2020-06-07 at 10:24 +0100, Russel Winder wrote:
> Hi,
>
> Why on earth is Dub sending out this error message (Invalid variable: DUB)
> on
> GitLab but not on Travis-CI or locally?
>
> OK, that was slightly rhetorical, more reasonably, why is dub sending out
> this
> message at all?
I am
Hi,
Why on earth is Dub sending out this error message (Invalid variable: DUB) on
GitLab but not on Travis-CI or locally?
OK, that was slightly rhetorical, more reasonably, why is dub sending out this
message at all?
--
Russel.
===
Dr Russel Winder t
27 matches
Mail list logo