To sort the names of the elements, I want to maintain the numbers correctly. i.e:
1 Hamlet
2 Ophelia
...
10 Laertes
instead
1 Hamlet
10 Laertes
2 Ophelia
...
Does anyone know of a comparison functor that already supports this?
(i.e. a predicate that can be passed to std::sort)
I basically have two templates for support: A leading number (as indicated above) and a number at the end, similar to explorer:
Dolly
Dolly (2)
Dolly (3)
(I think I could do this: compare by character and process numeric values ​​differently. However, this can break unicode collaiton and whatnot)
source
share