title: access private constructor c++
body: <p>I want only A can create B. (I also want to export otherAPIs method in header file.)
  but I can't put B constructor into private. is there a way to work around my question?
  thanks.  </p>
  
  <pre><code>class B
  {
  private:
  B()
  { // doing something}
  public:
  void otherAPIs()
  {}
  };
  
  class A
  {
  public:
  B *getSomething()
  { //doing something
     return new B()} 
  };
  </code></pre>