/* 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);
}