#include <vector>
usingnamespace std;
template<class T>
void de_serialize(T& t) {
}
template<class Content>
void de_serialize(vector<Content>& ct) {
Content c; // the Content should be packet* here
de_serialize(c);
}
struct packet {};
vector<packet*> v;
void de_serialize(packet* p) { // so this function should be called
p = new packet;
cout << "yes" << endl;
}
int main() {
de_serialize(v);
}
here's the code, I expect it prints "yes", but it popups a debug error messagebox, why is that?