.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OENewMolBase

.. oe:function:: OENewMolBase

   .. oe:api::

      OEMolBase* OENewMolBase(unsigned int type = OEMolBaseType::OEDefault)
      OEMolBase* OENewMolBase(const OEMolBase& mol,
                              unsigned int type = OEMolBaseType::OEDefault)


   Allocates an implementation of an :ref:`OEMolBase <OEChem_OEMolBase>` based on
   the integer 'type' argument.  The 'type' argument specifies the
   implementation type to be allocated, and should be one of the values
   listed in :oe:constns:`OEChem::OEMolBaseType`.  The returned molecule
   may be copy constructed from an existing :ref:`OEMolBase <OEChem_OEMolBase>`
   instance.  The pointer to the :ref:`OEMolBase <OEChem_OEMolBase>` memory
   returned by the function is allocated dynamically.  The ``delete``
   operator must be called for all returned instances to prevent memory leaks.

