Community
Participate
Working Groups
Build Identifier: 20110615-0604 The Eclipse source code formatter (Ctrl+Shift+F) incorrectly formats code that includes the boost library BOOST_FOREACH macro. As shown: void foo() { vector<int> vec; BOOST_FOREACH(int i, vec) { } } We can see the first '{' after the macro has 2 additional tabs. Reproducible: Always Steps to Reproduce: 1. Create C++ project 2. Use BOOST_FOREACH in function 3. Auto format code (Ctrl+Shift+F)
With CDT 8.1.2 the autoformatting results look different, but still not in the way it is supposed to be: void foo() { std::vector<int> vec; BOOST_FOREACH(int & i, vec){ ++i; } } Changing the active formatter profile does not seem to resolve the isssue.
I used this code: #include <string> #include <iostream> #include <vector> #include <boost/foreach.hpp> int main() { std::string hello("Hello, world!"); std::vector<int> vec; BOOST_FOREACH( int i, vec ) { std::cout << i; } return 0; } I can't reproduce this problem with CDT 9.7