cldoc icon indicating copy to clipboard operation
cldoc copied to clipboard

C++11 deleted constructor and assignment

Open jjrv opened this issue 11 years ago • 2 comments

If I delete the default copy constructor and assignment operator with C++11 syntax Type (const Type &)=delete; and Type &operator=(const Type &)=delete then cldoc generates documentation stubs for the functions as if they were present and did something interesting. Without the mentioned declarations they disappear from the documentation as they should.

A workaround is to handle the deletions using a macro, much like DISALLOW_COPY_AND_ASSIGN in Google's C++ style guide. Then cldoc can be run with something like -DCLDOC and such macros #ifdef'd away.

jjrv avatar Jul 21 '14 16:07 jjrv

This information is not currently available afaik, but we can probably do something with obtaining the tokens and simply checking if we get '=' 'delete' at the end of the declaration.

jessevdk avatar Sep 07 '14 12:09 jessevdk

For people following along at home, this is still happening in current master, and documents constructors written

Unit() = delete;

as

Unit ( )

suggesting that the constructor is available.

cbiffle avatar Jul 13 '15 17:07 cbiffle