]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Test that one can put a SmartPointer into a std::any object. 17676/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 6 Sep 2024 22:09:07 +0000 (16:09 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 6 Sep 2024 22:13:01 +0000 (16:13 -0600)
tests/base/smart_pointer_01.cc [new file with mode: 0644]
tests/base/smart_pointer_01.run_only [new file with mode: 0644]

diff --git a/tests/base/smart_pointer_01.cc b/tests/base/smart_pointer_01.cc
new file mode 100644 (file)
index 0000000..7b61efc
--- /dev/null
@@ -0,0 +1,42 @@
+// ------------------------------------------------------------------------
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
+// Copyright (C) 2024 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// Part of the source code is dual licensed under Apache-2.0 WITH
+// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
+// governing the source code and code contributions can be found in
+// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
+//
+// ------------------------------------------------------------------------
+
+
+
+// Check that it is possible to put SmartPointer objects into a
+// std::any object.
+
+
+#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/subscriptor.h>
+
+#include <any>
+#include <iostream>
+
+#include "../tests.h"
+
+
+class Test : public Subscriptor
+{};
+
+
+int
+main()
+{
+  initlog();
+
+  Test               t;
+  SmartPointer<Test> r(&t);
+  std::any           a = r;
+}
diff --git a/tests/base/smart_pointer_01.run_only b/tests/base/smart_pointer_01.run_only
new file mode 100644 (file)
index 0000000..e69de29

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.