   can't have smart pointer to incomplete type?
  I was attempting to use a boost scoped pointer for Pimpl, but discovered that they cannot be used with incomplete types. Why is this so? I assume it has something to do with the destructor of the smart pointer not being defined, but it seems like there should be a way around this.   
It can. See the Handle/Body Idiom section near the bottom and see the example header files to find what you're doing wrong.AFAIK only intrusive_ptr from the boost smart pointer library cannot be declared with an incomplete type. For obvious reasons.   ;  The weird thing is that initially it worked fine, but when I tried to create a shared pointer to the containing class, it gave compile errors.   ;Quote:AFAIK only intrusive_ptr from the boost smart pointer library cannot be declared with an incomplete type. For obvious reasons.No, boost::intrusive_ptr can be used with an incomplete type provided that the declarations for intrusive_ptr_add_ref() and intrusive_ptr_release() are visible.   ;Quote:Original post by SiCraneNo, boost::intrusive_ptr can be used with an incomplete type provided that the declarations for intrusive_ptr_add_ref() and intrusive_ptr_release() are visible.Y'know, that makes perfect sense now I think about it. I was going off past experience, but now I think back I was using a base type to handle the reference counting. Obviously an incomplete type wasn't aware that it was a child of that base, so I got errors. Turns out those reasons weren't so obvious after all.Quote:The weird thing is that initially it worked fine, but when I tried to create a shared pointer to the containing class, it gave compile errors.Judging by the quick little test I just threw together, you need to define a deconstructor for your interface type (not necessarily the implementation type). Looks like the default deconstructor is declared inline and therefore does not know about your type which is defined afterwards in the source file.   ;  Ok thanks, I got it working now. Defining an empty destructor looks kind of funny.   