#include #include #include #include #include #include template struct X { template void operator<<(const T &t) { Archive &archive = (*(Archive *) NULL); archive << t; } }; void dummy() { typedef boost::archive::text_oarchive Archive; X &x = * (X *) NULL; std::vector *pt = NULL; // uncomment this line to cause the test to fail //x << pt; } int main(int argc, char* argv[]) { std::vector v0(25, '%'); std::vector v1; std::ostringstream ostr; boost::archive::text_oarchive(ostr) & v0; std::istringstream istr(ostr.str()); boost::archive::text_iarchive(istr) & v1; bool ok = (v0 == v1); return 0; }