# Boost Flyweight Library

Tutorial

Flyweights are small-sized handle classes granting constant access to shared common data, thus allowing for the management of large amounts of entities within reasonable memory limits. Boost.Flyweight makes it easy to use this common programming idiom by providing the class template `flyweight<T>`, which acts as a drop-in replacement for `const T`.

Learning to use Boost.Flyweight can be accomplished in a matter of minutes. When special needs arise, however, an extensive customization interface is provided which allows the user to control and extend the following aspects:

- Type tagging for separation of domains using the same basic flyweight types.
- Specification and parameterization of the so-called flyweight factory.
- Control of the factory instantiation procedure.
- Specification of the internal synchronization mechanisms.
- Flyweight tracking, allowing for the disposal of stored values when no longer referenced by any flyweight object.

## Contents

- Tutorial
- Reference
- Performance
- Examples
- Tests
- Future work
- Release notes
- Acknowledgements

Tutorial

Revised September 3rd 2008

© Copyright 2006-2008 Joaquín M López Muñoz. 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)