On 06/16/2014 07:45 PM, George Sapkin wrote:
I'm trying to sort shared data with a predicate. Buy that causes 'unable
to format shared objects'. Here's an example reproducing the issue
without any threading code:

shared class SomeClass {
    immutable int value;

    this(const int value) {
       this.value = value;
    }
}

void main() {
     auto n = 10;
     auto data = new shared SomeClass[n];

     foreach (i; 0..n) data[i] = new shared SomeClass(i);
     auto sorted = sort!((a, b) => a.value < b.value)(data);
}

Good news: The code compiles with 2.066 after adding 'import std.algorithm;' :)

Ali

Reply via email to