Hi!
Can you please to compile this code either with string in the variant or a
vector.
Not sure if it helps but the variant documentation at
http://www.boost.org/doc/html/variant/reference.html states:
namespace boost {
template
class variant;
template<typename Sequence> class make_variant_over;
template
void swap(variant &, variant &);
template
std::basic_ostream &
operator<<(std::basic_ostream &,
const variant &); }
Which means that the types are not zero-index based. So your T5 would be a
string and not a vector. Make some tests like with simple integers, strings
and finally a vector and see what happens.
Best Regards,
Ovanes
-----Original Message-----
From: Nindi [mailto:Nindi73@yahoo.co.uk]
Sent: Sunday, June 25, 2006 15:36
To: boost-users@lists.boost.org
Subject: [Boost-users] Boost Variant OutputStreamable
I have started using Boost recently, and though I should switch my own
variant to the Boost Variant . However I cannot compile the following code
#include<iostream>
#include<vector>
#include<string>
#include
std::basic_ostream<char> &operator<<(std::basic_ostream<char>
&theostream,const std::vector<unsigned long> &theVector)
{
for(unsigned long i(0);i
BoostVariant;
};
typedef TpTemplateVariant::BoostVariant Tpvariant;
int main () {
Tpvariant p(5);
std::cout << p;
return 0;
}
The error I get is
error C2679: binary '<<' : no operator found which takes a right-hand
operand of type 'const T5'