Can't compile very simple snippet that uses boost::tuple
I am pretty sure it's because of my lack of skills with templates...
Still, I don't understand why I can stream a vector if it's on its own,
but not if it's stored in a boost::tuple. And it works with a std::pair!
Any hint?
#include
On Sat, 27 Nov 2004 19:25:20 -0800, Frank Astier
I am pretty sure it's because of my lack of skills with templates... Still, I don't understand why I can stream a vector if it's on its own, but not if it's stored in a boost::tuple. And it works with a std::pair! Any hint?
int main(int, char**) { vector<float> v; cout << v; // Works fine
pair
> p; cout << p; // Works fine tuple
t; cout << t; // <== WON'T COMPILE } Thanks,
Frank
I suspect it's because you need to define the operator<< for vector in the same namespace as vector (i.e. std) for the tuples operator<< to be able to find it. It's called 'argument dependent lookup'. Stuart Dootson
participants (2)
-
Frank Astier
-
Stuart Dootson