title: Boost::python static method returning instance of the class
body: <p>Following is the my <code>C++ class</code></p>
  
  <pre><code>namespace X {
    class ChildFactory: public Father {
    public:
      static ChildFactor* createChildFactory(const properties* ptr = NULLPTR);
    private :
      // no instances allowed
      ChildFactory();
      ChildFactory(const properties* ptr);
      ~ChildFactory();
    };
  }; 
  </code></pre>
  
  <p>following is how I have defined the <code>Boost::Python</code> constructs.</p>
  
  <pre><code>BOOST_PYTHON_MODULE(TestPy) 
  {
    boost::python::class_&lt;X::ChildFactory, boost::noncopyable&gt;("ChildFactory")
      .def("createChildFactory", &amp;X::ChildFactory::createChildFactory,  boost::python::return_value_policy&lt;boost::python::manage_new_object&gt;() )
      .staticmethod("createChildFactory")
    ;
  }
  </code></pre>
  
  <p>But it is giving me weird compiler template error. </p>
  
  <p>Error is </p>
  
  <pre><code>destructor could not be generated because a base class destructor is inaccessible
  </code></pre>