/* Boost.Flyweight test of concurrent_factory. * * Copyright 2024 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_concurrent_factory.hpp" #include /* keep it first to prevent nasty warns in MSVC */ #include #include #include #include #include #include #include #include #include #include "test_basic_template.hpp" using namespace boost::flyweights; struct concurrent_factory_flyweight_specifier1 { template struct apply { typedef flyweight > type; }; }; #if BOOST_WORKAROUND(BOOST_MSVC,<1930) /* Boost.MPL spuriously and failingly instantiates std::hash * in msvc 14.0 under some circumstances. */ #define STD_HASH boost::hash #else #define STD_HASH std::hash #endif struct concurrent_factory_flyweight_specifier2 { template struct apply { typedef flyweight< T, static_holder_class, no_locking, no_tracking, concurrent_factory_class< boost::mpl::_1,boost::mpl::_2, STD_HASH, std::equal_to, std::allocator > > type; }; }; struct concurrent_factory_flyweight_specifier3 { template struct apply { typedef flyweight< T, concurrent_factory< STD_HASH, std::equal_to, std::allocator >, static_holder_class, no_locking, no_tracking, tag > type; }; }; void test_concurrent_factory() { test_basic_template(); test_basic_template(); test_basic_template(); }