Re: Quotes and backticks together in a raw string

2021-08-18 Thread Brian Tiffin via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 22:34:54 UTC, jfondren wrote: On Wednesday, 18 August 2021 at 22:18:59 UTC, Brian Tiffin wrote: Google fu is failing on this one. string docs are at https://dlang.org/spec/lex.html Is there a way to have a raw multi-line string literal with both double-quotes

Re: How to get element type of a slice?

2021-08-18 Thread jfondren via Digitalmars-d-learn
On Thursday, 19 August 2021 at 03:32:47 UTC, Jesse Phillips wrote: On Thursday, 19 August 2021 at 03:29:03 UTC, Jesse Phillips wrote: On Tuesday, 17 August 2021 at 12:33:03 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 17 August 2021 at 12:26:36 UTC, jfondren wrote: On Tuesday, 17 August 2021 at 12:

Re: How to get element type of a slice?

2021-08-18 Thread Jesse Phillips via Digitalmars-d-learn
On Thursday, 19 August 2021 at 03:29:03 UTC, Jesse Phillips wrote: On Tuesday, 17 August 2021 at 12:33:03 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 17 August 2021 at 12:26:36 UTC, jfondren wrote: On Tuesday, 17 August 2021 at 12:21:31 UTC, Ferhat Kurtulmuş wrote: [...] This one's not in std.t

Re: How to get element type of a slice?

2021-08-18 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 12:33:03 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 17 August 2021 at 12:26:36 UTC, jfondren wrote: On Tuesday, 17 August 2021 at 12:21:31 UTC, Ferhat Kurtulmuş wrote: [...] This one's not in std.traits: ```d import std.range : ElementType; struct Point { int x,

Re: std.stdio.File is throwing with the message of: "Access Violation"

2021-08-18 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 17:42:53 UTC, Ruby The Roobster wrote: All I did was try to access a file with a self-made library. It didn't work. I tried again directly from the main file. This is the code: ```d File file = File("E:\\Users\\User\\Desktop\\dutils\\test.spr","r"); //T

Re: Quotes and backticks together in a raw string

2021-08-18 Thread jfondren via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 22:18:59 UTC, Brian Tiffin wrote: Google fu is failing on this one. string docs are at https://dlang.org/spec/lex.html Is there a way to have a raw multi-line string literal with both double-quotes and backticks inside? https://dlang.org/spec/lex.html#delim

Quotes and backticks together in a raw string

2021-08-18 Thread Brian Tiffin via Digitalmars-d-learn
Google fu is failing on this one. Is there a way to have a raw multi-line string literal with both double-quotes and backticks inside? Catenation works fine, busting up the literal, but can it be a single literal with both characters? Not a biggy, just curious.

Re: std.stdio.File is throwing with the message of: "Access Violation"

2021-08-18 Thread Ruby The Roobster via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 17:54:47 UTC, Paul Backus wrote: On Wednesday, 18 August 2021 at 17:42:53 UTC, Ruby The Roobster wrote: Output(Given to me by a message box that display's Throwable.msg in it's body): Access Violation Is this a bug, or me being stupid? If it's the latte

Re: How to get element type of a slice?

2021-08-18 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 14:40:20 UTC, Ferhat Kurtulmuş wrote: [snip] Very informative, thanks. My code is lying here[1]. I want my struct to accept 2d static arrays, random access ranges, and "std.container.Array". I could achieve it with its present form, and I will probably slightly m

Vibe.d error

2021-08-18 Thread JG via Digitalmars-d-learn
Hi, We are intermittently getting the following error: Accept TLS connection: server OpenSSL error at ../ssl/record/rec_layer_s3.c:1543: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown (SSL alert number 46) HTTP connection handler has thrown: Accepting SSL tunnel: e

Re: std.stdio.File is throwing with the message of: "Access Violation"

2021-08-18 Thread Ruby The Roobster via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 17:54:47 UTC, Paul Backus wrote: On Wednesday, 18 August 2021 at 17:42:53 UTC, Ruby The Roobster wrote: Output(Given to me by a message box that display's Throwable.msg in it's body): Access Violation Is this a bug, or me being stupid? If it's the latte

Re: std.stdio.File is throwing with the message of: "Access Violation"

2021-08-18 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 17:42:53 UTC, Ruby The Roobster wrote: Output(Given to me by a message box that display's Throwable.msg in it's body): Access Violation Is this a bug, or me being stupid? If it's the latter, than tell me what went wrong. I am using DMD 2.097.2 It's a

std.stdio.File is throwing with the message of: "Access Violation"

2021-08-18 Thread Ruby The Roobster via Digitalmars-d-learn
All I did was try to access a file with a self-made library. It didn't work. I tried again directly from the main file. This is the code: ```d File file = File("E:\\Users\\User\\Desktop\\dutils\\test.spr","r"); //This file exists on my system, so it should work... file.close(); `

Re: Non-consistent implicit function template specializations

2021-08-18 Thread Ali Çehreli via Digitalmars-d-learn
On 8/18/21 4:10 AM, Rekel wrote: >> isArray!T && (isArray!(ElementType!T)) > > I tried looking into how isArray is defined. Like, does being able to > index mean it's an array, or are these only static &/or dynamic arrays? The definitions are in phobos/std/traits.d enum bool isArray(T) = is

Re: Non-consistent implicit function template specializations

2021-08-18 Thread Rekel via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 13:35:07 UTC, Paul Backus wrote: On Wednesday, 18 August 2021 at 11:10:49 UTC, Rekel wrote: I tried looking into how isArray is defined. Like, does being able to index mean it's an array, or are these only static &/or dynamic arrays? Did you read the documentat

Re: Non-consistent implicit function template specializations

2021-08-18 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 11:10:49 UTC, Rekel wrote: I tried looking into how isArray is defined. Like, does being able to index mean it's an array, or are these only static &/or dynamic arrays? Did you read the documentation? https://phobos.dpldocs.info/std.traits.isArray.html

Re: Non-consistent implicit function template specializations

2021-08-18 Thread Rekel via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 18:46:05 UTC, Ali Çehreli wrote: I don't have such problems because I am not smart enough to understand that syntax so I don't use it. :) I use template constraints (which have other problems). Yeah, they seem to be a bit more trustworthy to some extent. If you

Re: Non-consistent implicit function template specializations

2021-08-18 Thread Rekel via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 18:27:21 UTC, Steven Schveighoffer wrote: According to my tests, it prefers the `T` version over the static array version. Which leads me to believe that it prefers a dynamic array over a static one. In fact, if I comment out the `T` version, it doesn't compile. It

Re: simple (I think) eponymous template question ... what is proper idimatic way ?

2021-08-18 Thread james.p.leblanc via Digitalmars-d-learn
On Wednesday, 18 August 2021 at 06:53:51 UTC, Tejas wrote: void funcTemplate(T:int)(T a){ writeln("argument is int"); } void funcTemplate(T : long)(T a){ writeln("argument is long integer"); } void main(){ int a; long b; func(a); func(b); funcTemplate(a);