Skip to content

Typo in classes example #8

@hamid914

Description

@hamid914

The description for getName member function is placed out of the def invocation:

.def("getName", &Dog::getName), "Getting the dog's name";

However the compiler ignores that description and the example works:

[ 50%] Building CXX object CMakeFiles/pet.dir/src/main.cpp.o
classes/src/main.cpp:38:37: warning: expression result unused [-Wunused-value]
    .def("getName", &Dog::getName), "Getting the dog's name";
                                    ^~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[100%] Linking CXX shared module pet.cpython-39-darwin.so
[100%] Built target pet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions