Hi,
Why wouldn't you just use reverse using Compare map key?
struct mycomp {
bool operator(int x,int y)
{
return x > y;
}
};
std::map<int,std::string,mycomp> revmap;
But generally it is not a problem to add such things
to template system.
I'll take a look on it.
(If you can send me a patch it will be even better you need just
to add some kind reverse option to foreach and replace begin(), end()
with rbegin() and rend())
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.sf.net/
CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/
----- Original Message -----
> From: Allan SIMON <all...@su...>
> To: cpp...@li...
> Cc:
> Sent: Friday, August 26, 2011 4:13 PM
> Subject: [Cppcms-users] [template request] foreach reverse
>
> Hi,
>
> A "simple" request, I would like to have the possibility to use
> reverse
> iterator inside template.
> As for example on tatoeba I have a map of
> <number_of_sentences,language>, and I want
> to display the languages which the language with most sentences first.
>
> thanks,
>
> Allan
>
>
> ------------------------------------------------------------------------------
> EMC VNX: the world's simplest storage, starting under $10K
> The only unified storage solution that offers unified management
> Up to 160% more powerful than alternatives and 25% more efficient.
> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
|