From: Wolfgang Bangerth Date: Sun, 24 May 2020 14:45:35 +0000 (-0600) Subject: C++14 updates to a couple of tutorials. X-Git-Tag: v9.3.0-rc1~1568^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18e2b9904b326643eb524ba095587eeb811d8a47;p=dealii.git C++14 updates to a couple of tutorials. --- 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();