boost-foreach Questions

3

Solved

Is it possible to replace the BOOST_FOREACH in this example with a "pure" C++11 equivalent? #include <map> #include <functional> #include <boost/foreach.hpp> #include <iostrea...
Filthy asked 9/5, 2012 at 20:30

3

I would like to have your advice regarding the usage of BOOST_FOREACH. I have read around it is not really recommended in terms of performance being a very heavy header. Moreover, it forces the u...
Subirrigate asked 21/2, 2013 at 10:46

3

Solved

Can you iterate over all files in a directory using boost::filesystem and BOOST_FOREACH? I tried path dirPath = ... int fileCount = 0; BOOST_FOREACH(const path& filePath, dirPath) if(is_regul...
Inga asked 4/1, 2012 at 10:31

1

I tried to write a simple loop through map<int, int>element and I'm wondering why the 1st syntax I used doesn't work/compile ? The 1st version I wrote was the following and it doesn't compil...
Horrendous asked 18/3, 2014 at 13:38

3

Solved

First of all I shall say that I think I got how it should be done but my code will not compile any way I try. I based my assumption on this official example of empty ptree trick. There you can find...
Dragonfly asked 11/7, 2011 at 20:49

4

Solved

I have this container: class /*final*/ Row { public: typedef FieldIterator const_iterator; typedef FieldIterator iterator; FieldIterator begin() const; FieldIterator end() const; FieldIterato...
Cereal asked 12/1, 2012 at 13:11

2

I know that boost or compiler should be last to blame, but I can't see another explanation here. I'm using msvc 2008 SP1 and boost 1.43. In the following code snippet execution never leaves third...
Excommunicatory asked 21/5, 2010 at 11:9

1

Solved

I'm building an application that gets movie information from themoviedb.com. The information is provided in a JSON file. I'm trying to store the information using boost property tree. But There is ...
Plassey asked 20/12, 2012 at 12:29

4

Solved

I'd like to replicate the following with BOOST FOREACH std::vector<int>::const_iterator i1; std::vector<int>::const_iterator i2; for( i1 = v1.begin(), i2 = v2.begin(); i1 < v1.end(...
Marsala asked 2/9, 2011 at 16:51

2

Solved

I'm doing something similar to this item Correct BOOST_FOREACH usage? However, my returned list is wrapped in a boost::shared_ptr. If I do not assign the list to a variable before the BOOST_FOREAC...
Manolo asked 4/7, 2011 at 15:45

2

Solved

I have a vector which I iterate over. The final element of the vector is special case, and I'd like to test for it separately. For example, I may do something as such: for (iterator = vector.begin...
Synchrotron asked 11/5, 2011 at 6:5

2

Solved

What would happen if a container that BOOST_FOREACH is iterating through is changed inside the BOOST_FOREACH scope? Does BOOST_FOREACH "freeze" the initial state?
Haroldharolda asked 21/4, 2011 at 11:49
1

© 2022 - 2024 — McMap. All rights reserved.