Boost logo

Boost :

From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2008-01-10 15:40:04


This question doesn't pertain to a particular Boost library, so I
apologize if it's too off-topic for the list.

According to http://www.boost.org/more/generic_programming.html , the
Associated Types of a Concept are either nested in the class
definition, or accessed through a traits class. With iterators,
traits were used because you can't nest typedefs within pointers,
which are valid iterators in many cases. With containers (such as
AssociativeContainerConcept), the Concepts require nested typedefs.

My questions are - when creating your own library, when do you choose
nested typedefs over a traits class, and what effects does it have on
a library user, both from a usability and extensibility point of view.
 What questions do you ask yourself to come to a decision?

Thanks,

--Michael Fawcett


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk