Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #5214
| From | Kai-Uwe Bux <jkherciueh@gmx.net> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: random map |
| Followup-To | comp.lang.c++ |
| Date | 2011-05-20 20:12 +0200 |
| Organization | University of Bielefeld |
| Message-ID | <ir6atv$sph$1@hoshi.visyn.net> (permalink) |
| References | <ir6a6f$ekl$1@online.de> |
Followups directed to: comp.lang.c++
Philipp Kraus wrote: > Hello, > > I habe a std::map and I would like to read k random key values. I have > tried it with the iterator like: > randvalue between [0, std::mapsize-1] > (*(std::map::iterator.begin() + randvalue)).first > > But this does not work, I'll get an error on stl_bvector.h with > std::_Bit_iterator std::operator+. How can I get k random key values > out of my map? Quick question: Do you want to allow repetitions or do you want k distinct random keys? Best, Kai-Uwe Bux
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
random map Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-05-20 19:59 +0200
Re: random map Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-05-20 20:12 +0200
Re: random map Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-05-20 20:18 +0200
Re: random map Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-05-20 20:36 +0200
Re: random map Juha Nieminen <nospam@thanks.invalid> - 2011-05-20 20:33 +0000
Re: random map Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-05-21 08:11 +0200
Re: random map Juha Nieminen <nospam@thanks.invalid> - 2011-05-21 08:32 +0000
Re: random map Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-05-21 13:20 +0200
csiph-web