]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce SmartPointer::get() 15896/head
authorPeter Munch <peterrmuench@gmail.com>
Sun, 20 Aug 2023 11:43:48 +0000 (13:43 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sun, 20 Aug 2023 11:43:48 +0000 (13:43 +0200)
include/deal.II/base/smartpointer.h

index 798f3992c355c891ae3faabe0dc4ddf8b5d08cb5..49dc336e7951af2deb8120837bc905b08b351511 100644 (file)
@@ -152,8 +152,15 @@ public:
   operator*() const;
 
   /**
-   * Dereferencing operator. This operator throws an ExcNotInitializedi() if the
-   * pointer is a null pointer.
+   * Return underlying pointer. This operator throws an ExcNotInitialized() if
+   * the pointer is a null pointer.
+   */
+  T *
+  get() const;
+
+  /**
+   * Operator that returns the underlying pointer. This operator throws an
+   * ExcNotInitialized() if the pointer is a null pointer.
    */
   T *
   operator->() const;
@@ -378,7 +385,7 @@ SmartPointer<T, P>::operator*() const
 
 template <typename T, typename P>
 inline T *
-SmartPointer<T, P>::operator->() const
+SmartPointer<T, P>::get() const
 {
   Assert(t != nullptr, ExcNotInitialized());
   Assert(pointed_to_object_is_alive,
@@ -388,6 +395,15 @@ SmartPointer<T, P>::operator->() const
 
 
 
+template <typename T, typename P>
+inline T *
+SmartPointer<T, P>::operator->() const
+{
+  return this->get();
+}
+
+
+
 template <typename T, typename P>
 template <class Q>
 inline void

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.