Hi,
I'm using Boost 1.38 and Visual Studio 2008.
The following code
#include
#include <ostream>
#include <vector>
using boost::format;
using std::ostream;
using std::vector;
ostream& operator<<(ostream& os, const vector<int>& v)
{
os << '[';
for(size_t i = 0; i < v.size(); ++i) {
if(i > 0) os << ' ';
os << v[i];
}
os << ']';
return os;
}
void f()
{
vector<int> v;
str(format("%1%") % v);
}
fails to compile with the error message
1>c:\libraries\boost\boost_1_38_0\boost\format\feed_args.hpp(100) : error C2679: binary '<<' : no
operator found which takes a right-hand operand of type 'const std::vector<_Ty>' (or there is no
acceptable conversion)
1> with
1> [
1> _Ty=int
1> ]
Why? How do I fix this?
Thank you,
Johan Råde