personalrobotics / chimera

:snake: A CLI tool for generating Boost.Python/pybind11 bindings from C/C++
BSD 3-Clause "New" or "Revised" License
13 stars 1 forks source link

Find a way to initialize field that has in-header initialization #296

Open jslee02 opened 4 years ago

jslee02 commented 4 years ago
// source.cpp
namespace chimera_test {
struct Dog {
  std::string name = "noname";
}
} // chimera_test
// binding.cpp
m.def_readwrite("format", &chimera_test::Dog::format)

name is not initialized with "noname".

>>> d = Dog()
>>> print(d.name)
''  # expectation is 'noname'