From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/flyweight/test/test_init.cpp | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/boost/libs/flyweight/test/test_init.cpp (limited to 'src/boost/libs/flyweight/test/test_init.cpp') diff --git a/src/boost/libs/flyweight/test/test_init.cpp b/src/boost/libs/flyweight/test/test_init.cpp new file mode 100644 index 00000000..5421b808 --- /dev/null +++ b/src/boost/libs/flyweight/test/test_init.cpp @@ -0,0 +1,49 @@ +/* Boost.Flyweight test of static data initialization facilities. + * + * Copyright 2006-2019 Joaquin M Lopez Munoz. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * See http://www.boost.org/libs/flyweight for library home page. + */ + +#include "test_init.hpp" + +#include /* keep it first to prevent nasty warns in MSVC */ +#include +#include + +using namespace boost::flyweights; + +template +struct marked_hashed_factory_class:hashed_factory_class +{ + marked_hashed_factory_class(){*pmark=true;} +}; + +template +struct marked_hashed_factory:factory_marker +{ + template + struct apply + { + typedef marked_hashed_factory_class type; + }; +}; + +namespace boost_flyweight_test{ + +bool mark1=false; +bool init1=flyweight >::init(); + +bool mark2=false; +flyweight >::initializer init2; + +} + +void test_init() +{ + BOOST_TEST(boost_flyweight_test::mark1); + BOOST_TEST(boost_flyweight_test::mark2); +} -- cgit v1.2.3