Cpp Heterogeneous Container

See GenericsVsSubtyping for the origins of this, where there is a discussion of HeterogeneousContainers and HomogeneousContainers, which invited the discussion of HeterogeneousContainers in CeePlusPlus.

Here are two possible ways of organising this. There may be more.

One is to build a container which can contain different types of object but with designated types of object in each position. This can be implemented using the BoostTupleLibrary, or BoostFusion which also has tuples optionally with the BoostFusionUserExtension.

The second is to have a container which contains objects of all the same type, but which are capable of holding data of different types. Strictly speaking this is a HomogeneousContainer of MutableTypeObjects?, such as those provided by BoostAny, but the effect is more flexible than the first type.
CategoryCpp CategoryContainer CategoryBoost

EditText of this page (last edited April 5, 2010) or FindPage with title or text search