On Wednesday, 11 August 2021 at 06:29:40 UTC, Tejas wrote:
```d
import std;
void main()
{
int[40] staticA;
auto c = staticA[0..50];//mistake
}```
results in:
```d
core.exception.RangeError@onlineapp.d(5): Range violation
??:? _d_arrayboundsp [0x55db29a0b645]
./onlineapp.
```d
import std;
void main()
{
int[40] staticA;
auto c = staticA[0..50];//mistake
}```
results in:
```d
core.exception.RangeError@onlineapp.d(5): Range violation
??:? _d_arrayboundsp [0x55db29a0b645]
./onlineapp.d:5 _Dmain [0x55db29a0ae8c]
```
Is there a way to make this
On Tuesday, 10 August 2021 at 21:19:39 UTC, Bastiaan Veelo wrote:
On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote:
Basically, what are the subtle gotcha's in the differences
between C++ and D code that looks similar
The only gotcha that comes to my mind is that `private` means
private
On Tuesday, 10 August 2021 at 19:03:06 UTC, Marcone wrote:
On Tuesday, 10 August 2021 at 19:01:42 UTC, Adam D Ruppe wrote:
On Tuesday, 10 August 2021 at 18:59:33 UTC, Marcone wrote:
Using -Lgdi32.lib -Luser32.lib? Same error.
The part after that:
If you want the Windows subsystem too, use
-
On 8/9/21 10:03 PM, nov wrote:
> i dreamed that programming will be less-error with compile checking
format.
I still think so because many errors that can be caught at compile time
are moved to run time in non-statically-typed languages.
> but reality disappoint :(
> message for every error
On Tuesday, 10 August 2021 at 18:13:17 UTC, Tejas wrote:
On Tuesday, 10 August 2021 at 18:07:35 UTC, Bastiaan Veelo
wrote:
On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote:
there's casting away const, a clearly seperate language
feature which has no equivalent in D;
You *can* cast away
On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote:
Basically, what are the subtle gotcha's in the differences
between C++ and D code that looks similar
The only gotcha that comes to my mind is that `private` means
private to the module in D, not private to the aggregate.
— Bastiaan.
On Tuesday, 10 August 2021 at 19:01:42 UTC, Adam D Ruppe wrote:
On Tuesday, 10 August 2021 at 18:59:33 UTC, Marcone wrote:
Using -Lgdi32.lib -Luser32.lib? Same error.
The part after that:
If you want the Windows subsystem too, use -L/subsystem:windows
-L/entry:mainCRTStartup.
Pass BOTH -L
On Tuesday, 10 August 2021 at 18:59:33 UTC, Marcone wrote:
Using -Lgdi32.lib -Luser32.lib? Same error.
The part after that:
If you want the Windows subsystem too, use -L/subsystem:windows
-L/entry:mainCRTStartup.
Pass BOTH -L/subsystem:windows AND -L/entry:mainCRTStartup
On Tuesday, 10 August 2021 at 18:51:28 UTC, Adam D Ruppe wrote:
On Tuesday, 10 August 2021 at 18:45:35 UTC, Marcone wrote:
Hi, do you have some other solution without
arsd.simpledisplay? I want only dmd feature.
Did you read the paragraph under the link? That IS a dmd
switch. Or a ldc switch.
On Tuesday, 10 August 2021 at 18:45:35 UTC, Marcone wrote:
Hi, do you have some other solution without arsd.simpledisplay?
I want only dmd feature.
Did you read the paragraph under the link? That IS a dmd switch.
Or a ldc switch. It explains the concept which works with
anything.
On Tuesday, 10 August 2021 at 18:36:27 UTC, Adam D Ruppe wrote:
On Tuesday, 10 August 2021 at 18:34:03 UTC, Marcone wrote:
How can I hide console using -m64?
http://dpldocs.info/experimental-docs/arsd.simpledisplay.html#installation-instructions
Hi, do you have some other solution without ar
On Tuesday, 10 August 2021 at 18:34:03 UTC, Marcone wrote:
How can I hide console using -m64?
http://dpldocs.info/experimental-docs/arsd.simpledisplay.html#installation-instructions
How use -L/SUBSYSTEM:windows for hide console in x64 prograns?
Becouse if I use -L/SUBSYSTEM:windows and -m64 I get this error:
lld-link: error: undefined symbol: WinMain
referenced by msvcrt120.lib(msvcrt_stub2.obj):($LN5)
Error: linker exited with status 1
If I delete -L/SUBSYSTEM:windows c
On Tuesday, 10 August 2021 at 18:07:35 UTC, Bastiaan Veelo wrote:
On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote:
there's casting away const, a clearly seperate language
feature which has no equivalent in D;
You *can* cast away `const` in D: https://run.dlang.io/is/sWa5Mf
— Bastiaan.
On Tuesday, 10 August 2021 at 16:00:37 UTC, Tejas wrote:
there's casting away const, a clearly seperate language feature
which has no equivalent in D;
You *can* cast away `const` in D: https://run.dlang.io/is/sWa5Mf
— Bastiaan.
On Tuesday, 10 August 2021 at 17:13:31 UTC, Marcone wrote:
On Tuesday, 10 August 2021 at 15:55:42 UTC, Bastiaan Veelo
wrote:
Use `size_t` and `ptrdiff_t` instead to make your program
compile in both 32 bit and 64 bit modes.
https://dlang.org/spec/type.html#aliased-types
-- Bastiaan.
Thank y
On Tuesday, 10 August 2021 at 15:55:42 UTC, Bastiaan Veelo wrote:
On Tuesday, 10 August 2021 at 01:29:04 UTC, Marcone wrote:
Solved converting long and int.
Use `size_t` and `ptrdiff_t` instead to make your program
compile in both 32 bit and 64 bit modes.
https://dlang.org/spec/type.html#al
On Tuesday, 10 August 2021 at 15:32:25 UTC, Dennis wrote:
Thanks for this solution as well.
On Tuesday, 10 August 2021 at 13:10:23 UTC, Paul Backus wrote:
Would definitely be nice to have this in the language, though.
Do you know more use cases for this?
I've written range pipelines like th
On Tuesday, 10 August 2021 at 13:18:24 UTC, Paul Backus wrote:
On Tuesday, 10 August 2021 at 11:05:53 UTC, Tejas wrote:
Also, I have read here a principle that
**If it looks like C, it behaves like C**
How true is that for C++? Does code that look like C++(minus
obvious syntax differences) be
On Tuesday, 10 August 2021 at 01:29:04 UTC, Marcone wrote:
Solved converting long and int.
Use `size_t` and `ptrdiff_t` instead to make your program compile
in both 32 bit and 64 bit modes.
https://dlang.org/spec/type.html#aliased-types
-- Bastiaan.
Thanks for this solution as well.
On Tuesday, 10 August 2021 at 13:10:23 UTC, Paul Backus wrote:
Would definitely be nice to have this in the language, though.
Do you know more use cases for this?
On Tuesday, 10 August 2021 at 11:05:53 UTC, Tejas wrote:
Also, I have read here a principle that
**If it looks like C, it behaves like C**
How true is that for C++? Does code that look like C++(minus
obvious syntax differences) behave like C++?
No. D and C++ have different semantics for many
On Tuesday, 10 August 2021 at 12:01:24 UTC, Dennis wrote:
```D
struct Vec {
float x, y, z;
}
void setPosition(float x, float y, float z) {
}
void main() {
Vec posS = Vec(10, 20, 30);
setPosition(posS.tupleof); // pass
float[3] posA = [10, 20, 30];
setPosition(posA.tupleof)
Thanks! I was considering turning the static array into an
AliasSeq directly, but casting it to a struct and doing tupleof
on that is pretty smart.
On Tuesday, 10 August 2021 at 12:50:55 UTC, jfondren wrote:
And I don't see very many static-array-generic functions in
Phobos.
Indeed, static a
On Tuesday, 10 August 2021 at 12:01:24 UTC, Dennis wrote:
```D
struct Vec {
float x, y, z;
}
void setPosition(float x, float y, float z) {
}
void main() {
Vec posS = Vec(10, 20, 30);
setPosition(posS.tupleof); // pass
float[3] posA = [10, 20, 30];
setPosition(posA.tupleof)
```D
struct Vec {
float x, y, z;
}
void setPosition(float x, float y, float z) {
}
void main() {
Vec posS = Vec(10, 20, 30);
setPosition(posS.tupleof); // pass
float[3] posA = [10, 20, 30];
setPosition(posA.tupleof); // Error: no property `tupleof`
for type `float[3]`
}
`
What exactly does the above statement mean?
Also, I have read here a principle that
**If it looks like C, it behaves like C**
How true is that for C++? Does code that look like C++(minus
obvious syntax differences) behave like C++?
Does having the same memory model help?
Thanks for reading!
On Tuesday, 10 August 2021 at 05:03:12 UTC, nov wrote:
every time i try to use templates, i have problems :(
That is why C++ introduced concepts. Wonder when D will be
getting them :(
29 matches
Mail list logo