Re: Sorting structs?

2014-01-29 Thread Boomerang
Also sorry for double posting but I'm confused how the sorting works when we only specify to be sorted by grade. I think in C++, disregarding other data members can lead to loss of data in things such as std::set.

Re: Sorting structs?

2014-01-29 Thread Boomerang
Thanks for the help so far. My current code is here: http://dpaste.dzfl.pl/b9acff399649 Are there problems with my code, or do you have suggestions to improve it?

Sorting structs?

2014-01-29 Thread Boomerang
Hello everybody. I'm trying to learn D by solving simple exercises. The current exercise: read names and grades of students, then print the names of students in descending order of their grades. In C++, I would define a Student struct, overload the operators: bool operator<(const Student&, const