Hi,
 
Sorry trivial questions I'm sure.
Why doesn't the lexical_cast work below?
I think it meets the concept description.
>>>>> play.cpp >>>>
 
#include <vector>
#include <iostream>
#include <algorithm>
 
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>
#include <sstream>
 
using namespace std;
using namespace boost;
using namespace boost::filesystem;
 
template<class T>
ostream&
operator<< (ostream& os, const vector<T>& v)
{
  copy(v.begin(), v.end(), ostream_iterator<T>(os, ";"));
  return os;
}
 
template<class T>
string
v2s(const vector<T>& v)
{
  stringstream ss;
  copy(v.begin(), v.end(), ostream_iterator<T>(ss, ";"));
  return ss.str();
}
 
int
main(int argc,
     char* argv[])
{
  vector<string> v;
  v.push_back("hello");
  v.push_back("world");
 
  cout << v << endl;
 
  cout << v2s(v) << endl;
 
  cout << lexical_cast<string>(v) << endl; // XXX doesn't compile...XXX
  return 0;
}
Any help greatly appreciated.
 
Andy