Re: Implementing swap for user-defined swaps

2017-10-07 Thread ag0aep6g via Digitalmars-d-learn
On 10/07/2017 07:55 PM, Balagopal Komarath wrote:   I was implement my own range type that forwards all accesses to another range. I tried to write a `swap` function so that sort etc. could be called on my range. However, I cannot get `hasSwappableElements!ARange` to evaluate to true. But, whe

Implementing swap for user-defined swaps

2017-10-07 Thread Balagopal Komarath via Digitalmars-d-learn
Hello, I was implement my own range type that forwards all accesses to another range. I tried to write a `swap` function so that sort etc. could be called on my range. However, I cannot get `hasSwappableElements!ARange` to evaluate to true. But, when I copy pasted the definition of `hasSwap