[LOG] formatting_ostream API change
I had the following code, which worked in 1.58: #include <boost/log/trivial.hpp> #include <boost/exception/all.hpp> #include <boost/algorithm/string.hpp> /// @todo move elsewhere, because it will conflict with others' implementations of outputting vectors template<typename T> inline boost::log::formatting_ostream& operator<<(boost::log:: formatting_ostream& out, std::vector<T>& v) { out << "["; size_t last = v.size() - 1; for(size_t i = 0; i < v.size(); ++i) { out << v[i]; if (i != last) out << ", "; } out << "]"; return out; } I used it to output a std::vector<float> as follows: BOOST_LOG_TRIVIAL(trace) << “Real joint angles from FRI: " << realJointPosition << "\n"; However this now seems to fail in 1.59. I’ve created a github gist with the compiler output <https://gist.github.com/ahundt/5869dbd09e889b7153c3> in case that’s helpful as well. I see that the update recently had some breaking changes, what is the new way to provide the desired functionality? Thanks for your help. Cheers! Andrew Hundt
On 2015-11-09 20:20, Andrew Hundt wrote:
I had the following code, which worked in 1.58:
[snip]
I used it to output a std::vector<float> as follows:
BOOST_LOG_TRIVIAL(trace) << “Real joint angles from FRI: " << realJointPosition << "\n";
However this now seems to fail in 1.59. I’ve created a github gist with the compiler output <https://gist.github.com/ahundt/5869dbd09e889b7153c3> in case that’s helpful as well. I see that the update recently had some breaking changes, what is the new way to provide the desired functionality?
It's probably caused by this bug: https://svn.boost.org/trac/boost/ticket/11549
On Mon, Nov 9, 2015 at 12:25 PM, Andrey Semashev <andrey.semashev@gmail.com> wrote:
That looks like it is the problem. I guess this will be fixed in 1.60? Cheers! Andrew Hundt
On Wed, Dec 9, 2015 at 2:31 AM, Andrew Hundt <athundt@gmail.com> wrote:
On Mon, Nov 9, 2015 at 12:25 PM, Andrey Semashev <andrey.semashev@gmail.com> wrote:
That looks like it is the problem. I guess this will be fixed in 1.60?
Yes. You can test the beta that has just been released. http://sourceforge.net/projects/boost/files/boost/1.60.0.beta.1/
participants (2)
-
Andrew Hundt
-
Andrey Semashev