cpp-pybind11-playground icon indicating copy to clipboard operation
cpp-pybind11-playground copied to clipboard

Typo in classes example

Open hamid914 opened this issue 3 years ago • 0 comments

The description for getName member function is placed out of the def invocation: https://github.com/aoloe/cpp-pybind11-playground/blob/c2a3d9a7a83b5cc39eba74c8dcc613f05ac086d7/classes/src/main.cpp#L34 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

hamid914 avatar Sep 03 '21 22:09 hamid914