Wrong serialization of method classes in c++

Serialization classes for methods with return type void must not serialize anything.