From 5edc7aa3923a3e8523c10a9a2062a2392086c5c7 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 6 Sep 2024 16:09:07 -0600 Subject: [PATCH] Test that one can put a SmartPointer into a std::any object. --- tests/base/smart_pointer_01.cc | 42 ++++++++++++++++++++++++++++ tests/base/smart_pointer_01.run_only | 0 2 files changed, 42 insertions(+) create mode 100644 tests/base/smart_pointer_01.cc create mode 100644 tests/base/smart_pointer_01.run_only diff --git a/tests/base/smart_pointer_01.cc b/tests/base/smart_pointer_01.cc new file mode 100644 index 0000000000..7b61efc635 --- /dev/null +++ b/tests/base/smart_pointer_01.cc @@ -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 +#include + +#include +#include + +#include "../tests.h" + + +class Test : public Subscriptor +{}; + + +int +main() +{ + initlog(); + + Test t; + SmartPointer 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 index 0000000000..e69de29bb2 -- 2.39.5