The generated c++ classes for struct's do not have a common base class.
The patch adds two options to the compiler:
- line_first : first line before all includes
- base_struct : custom base class for structs
thrift --gen cpp:line_first='#include <path/TBase.h>',base_struct=':public TBase' ./MyService.thrift
The default, without any option:
thrift --gen cpp ./MyService.thrift
The idea is to have a base class for typecasting, which can be done with: