Ticket #5965: Base.hpp

File Base.hpp, 357 bytes (added by Simon <simon.siemens@…>, 11 years ago)

The base class with a forward declaration and a range for a certain sub-class.

Line 
1#include <boost/range/adaptor/indirected.hpp>
2#include <list>
3
4class Derived;
5
6template<class T>
7class Base
8{
9public:
10 T&
11 get()
12 {
13 return x_;
14 }
15
16protected:
17 typedef std::list<Derived*> DerivedList;
18 typedef boost::indirected_range<DerivedList> DerivedRange;
19
20 DerivedRange
21 range()
22 {
23 return DerivedRange(l_);
24 }
25
26 DerivedList l_;
27 T x_;
28};