title: Dealing with incomplete types
body: <p>I have two classes: one of them has an incomplete type, and the second needs to use that incomplete type. Is there any way to reference an "external type", in a manner similar to how you reference an external object?</p>
  
  <hr>
  
  <p><strong>Edit:</strong> Details about the structure of my classes.</p>
  
  <p>Unfortunately I can't use pointers either. My code looks something like this:</p>
  
  <pre><code>class CompleteA {
    private:
      friend CompleteB;
      struct IncompleteA;
      boost::shared_ptr&lt;IncompleteA&gt; data_;
  };
  
  class CompleteB {
     public:
       void SomeFct(CompleteA&amp; a) {
          // I need to access a member of the incomplete type
          a.data_-&gt;someMember;
       }
  };
  </code></pre>
  
  <p>I could have a separate header and source files pair but the that would be a bit of an overkill in my case. The incomplete type is just a struct with one member; I use it to hide the implementation. (However, if there's no other option, I will resort to having a separate header...)</p>
  
  <p>About my use of friend, please ignore that and concentrate on what I'm asking help with. I've pondered about whether or not I should use friend here and I've come to the conclusion that using getters (instead of a friend) would expose the implementation.</p>