// Create a solver object of the kind indicated by the argument to this
// function. If the name is not recognized, throw an exception!
- // The respective solver object is stored in a std::unique_ptr to avoid
- // having to delete the pointer after use. For initializing, we want to use
- // the C++14 function std::make_unique. Since deal.II only requires C++11 up
- // to now, we define this function in a separate namespace called
- // `std`. In case the compiler supports C++14, this just calls
- // std::make_unique.
+ // The respective solver object is stored in a `std::unique_ptr` to avoid
+ // having to delete the pointer after use.
std::unique_ptr<LaplaceSolver::Base<dim>> solver;
if (solver_name == "global")
solver = std::make_unique<LaplaceSolver::RefinementGlobal<dim>>(
}
- // This function is required by the interface of the Manifold base class,
- // and allows you to clone the AfricaGeometry class. This is where we use
- // a C++14 feature, namely the make_unique function, that simplifies the
- // creation of std::unique_ptr objects. Notice that, while the function
- // returns a std::unique_ptr<Manifold<3,3>>, we internally create a
- // unique_ptr<AfricaGeometry>.
+ // The next function is required by the interface of the
+ // Manifold base class, and allows cloning the AfricaGeometry
+ // class. Notice that, while the function returns a
+ // `std::unique_ptr<Manifold<3,3>>`, we internally create a
+ // `unique_ptr<AfricaGeometry>`. In other words, the library
+ // requires a pointer-to-base-class, which we provide by creating a
+ // pointer-to-derived-class.
std::unique_ptr<Manifold<3, 3>> AfricaGeometry::clone() const
{
return std::make_unique<AfricaGeometry>();