Boost logo

Boost Users :

From: Neal Becker (ndbecker2_at_[hidden])
Date: 2007-09-16 18:45:42


I'm stumped as to why my template typedef simulation doesn't work with
serialization.

Here's a simple example:

template<typename T>
struct A {
};

template<typename T>
struct B {
  typedef A<T> type;
};

namespace boost { namespace serialization {
  template<class Archive, class T>
  inline void serialize (Archive &ar, typename B<T>::type & v, const
unsigned int file_version) { <<< This won't work
  //inline void serialize (Archive &ar, A<T> & v, const unsigned int
file_version) { <<< This is OK
    boost::serialization::split_free (ar, v, file_version);
  }
}
}

I expected typename B<T>::type is equivalent to A<T>, but gcc-4.1.2 doesn't
agree. The latter compiles, but the 1st gives:
/usr/local/src/boost.hg/boost/serialization/access.hpp:109: error: ‘struct
A<int>’ has no member named ‘serialize’


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net