From 18e2b9904b326643eb524ba095587eeb811d8a47 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 24 May 2020 08:45:35 -0600 Subject: [PATCH] C++14 updates to a couple of tutorials. --- examples/step-13/step-13.cc | 8 ++------ examples/step-53/step-53.cc | 13 +++++++------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/examples/step-13/step-13.cc b/examples/step-13/step-13.cc index dbd81a07f8..2a7c381349 100644 --- a/examples/step-13/step-13.cc +++ b/examples/step-13/step-13.cc @@ -1364,12 +1364,8 @@ namespace Step13 // 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> solver; if (solver_name == "global") solver = std::make_unique>( diff --git a/examples/step-53/step-53.cc b/examples/step-53/step-53.cc index c60f86b6f7..88943e5c00 100644 --- a/examples/step-53/step-53.cc +++ b/examples/step-53/step-53.cc @@ -221,12 +221,13 @@ namespace Step53 } - // 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>, we internally create a - // unique_ptr. + // 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>`, we internally create a + // `unique_ptr`. In other words, the library + // requires a pointer-to-base-class, which we provide by creating a + // pointer-to-derived-class. std::unique_ptr> AfricaGeometry::clone() const { return std::make_unique(); -- 2.39.5