Ticket #5965: Base.hpp
| File Base.hpp, 357 bytes (added by , 11 years ago) | 
|---|
| Line | |
|---|---|
| 1 | #include <boost/range/adaptor/indirected.hpp> | 
| 2 | #include <list> | 
| 3 | |
| 4 | class Derived; | 
| 5 | |
| 6 | template<class T> | 
| 7 | class Base | 
| 8 | { | 
| 9 | public: | 
| 10 | T& | 
| 11 | get() | 
| 12 | { | 
| 13 | return x_; | 
| 14 | } | 
| 15 | |
| 16 | protected: | 
| 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 | }; | 
