On 3/2/15 8:52 AM, "Nordlöw" wrote:
On Friday, 27 February 2015 at 15:00:35 UTC, Steven Schveighoffer wrote:
Hm... what about:
return count < rhs.count ? -1 : count > rhs.count ? 1 : rank <
rhs.rank ? -1 : rank > rhs.rank;
Is this more efficient than my version?
You said "more compact", not
On Friday, 27 February 2015 at 15:00:35 UTC, Steven Schveighoffer
wrote:
Hm... what about:
return count < rhs.count ? -1 : count > rhs.count ? 1 : rank <
rhs.rank ? -1 : rank > rhs.rank;
Is this more efficient than my version?
On 02/27/2015 03:04 AM, "Nordlöw" wrote:
Is there a more compact way to describe the opCmp function in the
following struct
Please see:
http://forum.dlang.org/thread/lnr99a$vvd$1...@digitalmars.com#post-lnr99a:24vvd:241:40digitalmars.com
Ali
On 2/27/15 6:04 AM, "Nordlöw" wrote:
Is there a more compact way to describe the opCmp function in the
following struct
struct Hit
{
size_t count; // number of walkers that found this node
NWeight rank; // rank (either minimum distance or maximum strength)
auto opCmp(const Hit rh
On Friday, 27 February 2015 at 11:04:51 UTC, Nordlöw wrote:
Is there a more compact way to describe the opCmp function in
the following struct
struct Hit
{
size_t count; // number of walkers that found this node
NWeight rank; // rank (either minimum distance or maximum
strength)
Is there a more compact way to describe the opCmp function in the
following struct
struct Hit
{
size_t count; // number of walkers that found this node
NWeight rank; // rank (either minimum distance or maximum
strength)
auto opCmp(const Hit rhs) const
{
if (this.c