When I use the pimpl idiom, is it useful to put all the method definitions inside the class definition? For example:
As far as I know, the only problems with setting the method definition inside the class definition is that (1) the implementation is visible in files that include the class definition, and (2) the compiler can make the inline method.
This is not a problem in this case, since the class is defined in a private file, and the attachment is not affected, since the methods are called only in one place.
The advantage of placing a definition inside a class is that you do not need to repeat the method signature.
So, is that normal? Are there any other issues you need to know about?
c ++ inline pimpl-idiom
Amnon
source share