Skip to content

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

@jslee02

Description

@jslee02
// 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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions