Skip to content

Instantly share code, notes, and snippets.

@eiennohito
Created September 10, 2012 11:48
Show Gist options
  • Save eiennohito/3690481 to your computer and use it in GitHub Desktop.
Save eiennohito/3690481 to your computer and use it in GitHub Desktop.
class xxx_serializer {
template<typename T>
void archive(T& obj) { serialize(obj); } //redirect
template<typename T>
void serialize(T& obj) {
xxx_serializer_impl<T> impl(&this);
impl.do_work(obj);
}
}
template<typename Arch, typename T>
void archive(Arch& arch, T& obj) { arch.archive(obj); } // default template implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment