On Tuesday, 17 June 2014 at 07:53:51 UTC, monarch_dodra wrote:
On Tuesday, 17 June 2014 at 04:32:20 UTC, Jakob Ovrum wrote:
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote:
MyCompare cmp(SortOrder.ASC, 10);
This syntax is not valid D.
It should be:
auto cmp = MyCompare(SortO
On Tuesday, 17 June 2014 at 04:32:20 UTC, Jakob Ovrum wrote:
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote:
MyCompare cmp(SortOrder.ASC, 10);
This syntax is not valid D.
It should be:
auto cmp = MyCompare(SortOrder,ASC, 10);
Well, techincally, the *syntax* is valid. If "
On Tuesday, 17 June 2014 at 04:32:20 UTC, Jakob Ovrum wrote:
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote:
MyCompare cmp(SortOrder.ASC, 10);
This syntax is not valid D.
It should be:
auto cmp = MyCompare(SortOrder,ASC, 10);
Sorry, that first comma is a typo and should b
On Monday, 16 June 2014 at 20:49:29 UTC, monarch_dodra wrote:
MyCompare cmp(SortOrder.ASC, 10);
This syntax is not valid D.
It should be:
auto cmp = MyCompare(SortOrder,ASC, 10);
On Monday, 16 June 2014 at 09:24:22 UTC, Marc Schütz wrote:
You can pass anything to the sort function that's callable,
including an object:
struct MyCompare {
SortOrder order;
int column;
bool opCall(const ref DataRow lhs, const ref DataRow
rhs) {
retu
You can pass anything to the sort function that's callable,
including an object:
struct MyCompare {
SortOrder order;
int column;
bool opCall(const ref DataRow lhs, const ref DataRow rhs)
{
return order == SortOrder.ASC ?
lhs[column] < rhs
I am new to D so I am probably not using the right terminology
but here is a piece of C++ code (not complete) that I would like
to translate to idiomatic D.
I have defined a function object that I pass to std::sort to
std:map as follows:
enum class SortOrder{ ASC, DESC };
typedef std::vector D