class X {
public:
typedef std::list Container;
// (1)
const Container& GetElements() const;
// (2)
Container::iterator Element
Off course, the simplest is this :
class X {
public:
typedef std::list Container;
Container m_container;
};
but that makes your class X
obsolete.
Other then that, if you really like your class, then add next methods :
Container::const_iterator ElementBegin() const;
Container::const_iterator ElementEnd() const;
int size() const;