包装Boost Python模块中的typedef结构



我在标题中定义了一个typedef,如下所示:

typedef struct data
{
std::string id;
std::string status;
} data_set;

我希望能够将其封装在BoostPython模块中,使其可用,因为它已传递到其他方法中。这会被包装成boost中的类吗?或者有没有一种特殊的方式来包装typedefs?

我认为这里不需要typedef。简单

struct data_set
{
std::string id;
std::string status;
};

基本上是等效的。话虽如此,现在您可以将它视为一个带有BoostPython模块的类。

最新更新