From: Wolfgang Bangerth Date: Fri, 6 Sep 2024 22:09:07 +0000 (-0600) Subject: Test that one can put a SmartPointer into a std::any object. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17676%2Fhead;p=dealii.git Test that one can put a SmartPointer into a std::any object. --- 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