Sorting array with different order

bearophile bearophileHUGS at lycos.com
Wed Aug 7 07:38:39 PDT 2013


Grzeogorz Łuszczek:

> I will be glad if someone could help me with my problem.

Such questions are better asked in D.learn newsgroup.

Every time you instantiate the sort function with different 
template arguments, you generate a different type. So you could 
use a variant, or probably better to find a different solution. 
You could store just the arguments of the sort template, like the 
string "a.ipAddress < b.ipAddress" or the equivalent lambda, and 
later use it as arguments to instantiate the sort when you need 
it.

Bye,
bearophile


More information about the Digitalmars-d mailing list