Re: Implicit conversion of unique chars[] to string

2021-03-22 Thread ag0aep6g via Digitalmars-d-learn
On 23.03.21 02:07, Steven Schveighoffer wrote: const(char)[] x = "foo"; string chained = chainPath(x, "bar").array; Error: cannot implicitly convert expression array(chainPath(x, "bar")) of type const(char)[] to string And the answer is complex. You can't accept a const range, because they d

Re: Contributing CDF bindings to Deimos

2021-03-22 Thread mw via Digitalmars-d-learn
On Tuesday, 23 March 2021 at 05:34:57 UTC, Chris Piker wrote: Hi D There is a C library that's important for my line of work, https://cdf.gsfc.nasa.gov/ but it's not exactly a popular library in the general sense. I willing to contribute & maintain D bindings for this library following th

Contributing CDF bindings to Deimos

2021-03-22 Thread Chris Piker via Digitalmars-d-learn
Hi D There is a C library that's important for my line of work, https://cdf.gsfc.nasa.gov/ but it's not exactly a popular library in the general sense. I willing to contribute & maintain D bindings for this library following the Deimos guidelines but am wondering if it's too specific to b

Re: noobie question, dub or meson?

2021-03-22 Thread Chris Piker via Digitalmars-d-learn
On Saturday, 20 March 2021 at 18:33:20 UTC, James Blachly wrote: Chris: for one of my (D) libraries that also links in an .o file that's built from C source, I have a makefile for the C and call `make` during the dub build process. It is not incredibly sophisticated, but works well for us. Her

Re: Implicit conversion of unique chars[] to string

2021-03-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/22/21 5:58 PM, ag0aep6g wrote: On 22.03.21 21:38, Per Nordlöw wrote: Am I the only one being annoyed by the fact that chainPath(...).array doesn't implicit convert to string despite the array returned from .array is allocated by the GC. Works for me: import std.array: array;

Re: 2.096.0 linker errors

2021-03-22 Thread mw via Digitalmars-d-learn
On Monday, 22 March 2021 at 23:35:09 UTC, Curtis wrote: Using 2.096.0, I'm getting a number of "undefined reference" ... The code compiles and links with 2.091.1 but I'm not sure what has changed since then that might cause this problem. I am working on creating a reduced test case using Dustm

2.096.0 linker errors

2021-03-22 Thread Curtis via Digitalmars-d-learn
Using 2.096.0, I'm getting a number of "undefined reference" linker errors that I haven't been able to figure out how to resolve. The first linker error is undefined reference to std.typecons.Typedef: ``` src/phobos/std/typecons.d:7569: error: undefined reference to '_D3std8typecons__T7Typed

Re: Implicit conversion of unique chars[] to string

2021-03-22 Thread ag0aep6g via Digitalmars-d-learn
On 22.03.21 21:38, Per Nordlöw wrote: Am I the only one being annoyed by the fact that     chainPath(...).array doesn't implicit convert to string despite the array returned from .array is allocated by the GC. Works for me: import std.array: array; import std.path: chainPath; void mai

Re: Implicit conversion of unique chars[] to string

2021-03-22 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 22 March 2021 at 20:38:36 UTC, Per Nordlöw wrote: chainPath(...).array To clarify, for instance, given string s; const(char)[] c; all the calls chainPath(s, s).array chainPath(c, c).array chainPath(s, c).array chainPath(c, s).array return a

Implicit conversion of unique chars[] to string

2021-03-22 Thread Per Nordlöw via Digitalmars-d-learn
Am I the only one being annoyed by the fact that chainPath(...).array doesn't implicit convert to string despite the array returned from .array is allocated by the GC. Yes, I know that I should do chainPath(...).array.assumeUnique but the uniqueness of .array (and in turn implicit c

Re: Strange error

2021-03-22 Thread MichaelJames via Digitalmars-d-learn
On Sunday, 21 March 2021 at 07:18:10 UTC, Jack Applegame wrote: Could someone please explain what is wrong with this code? https://glot.io/snippets/fwxn2198kv ```d import std.stdio; struct Sample{ void function() func1; void function() func2; } void noth(Sample smpl)() { smpl.func1(); /