cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
c++ set insert in descending order ?
c++ set insert in descending order ?
Jan 4, 2017 at 6:08pm UTC
mohamedeltair
(50)
insert in c++ set does its job in ascending order, is there a way to make it work in descending order ?
Jan 4, 2017 at 6:13pm UTC
helios
(17501)
By default, std::set uses std::less. To cause it to sort in reverse order, use std::greater. E.g.
std::set<
int
, std::greater> s;
Jan 4, 2017 at 6:18pm UTC
mohamedeltair
(50)
thank you
Topic archived. No new replies allowed.