Re: Cannot call find with haystack elements having a explicit copy constructors

2021-07-15 Thread RazvanN via Digitalmars-d-learn
On Thursday, 15 July 2021 at 11:08:25 UTC, Per Nordlöw wrote: The adding of copy construtors to `Service` defined as ```d @safe struct Service { this(ref return scope typeof(this) rhs) {} this(const ref return scope typeof(this) rhs) const {} } @safe struct Session { void openAndGet

Re: Cannot call find with haystack elements having a explicit copy constructors

2021-07-15 Thread Per Nordlöw via Digitalmars-d-learn
On Thursday, 15 July 2021 at 11:08:25 UTC, Per Nordlöw wrote: The adding of copy construtors to `Service` defined as ```d @safe struct Service { this(ref return scope typeof(this) rhs) {} this(const ref return scope typeof(this) rhs) const {} } Using `inout` as ```d @safe struct Servi

Re: Cannot call find with haystack elements having a explicit copy constructors

2021-07-15 Thread Per Nordlöw via Digitalmars-d-learn
On Thursday, 15 July 2021 at 11:08:25 UTC, Per Nordlöw wrote: fails in the same way. What's wrong? ```d @safe struct Service { this(ref typeof(this) rhs) {} this(const ref typeof(this) rhs) const {} } ``` also fails. On the other hand, using a postblit as ``` @safe struct Service {

Cannot call find with haystack elements having a explicit copy constructors

2021-07-15 Thread Per Nordlöw via Digitalmars-d-learn
The adding of copy construtors to `Service` defined as ```d @safe struct Service { this(ref return scope typeof(this) rhs) {} this(const ref return scope typeof(this) rhs) const {} } @safe struct Session { void openAndGetService(in string key) scope { import std.algorithm.sea