|
Revision 173e2ce96a7bde630476defe34fae1b5ed1baaba, 1.8 KB
(checked in by Antti-Juhani Kaijanaho <antti-juhani@…>, 16 months ago)
|
|
#79: Kill tlate::msg_value precursor and followup lists if they are empty
Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>
|
-
Property mode set to
100644
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #ifndef GUARD_TLATE_LIST_VALUE_HH |
|---|
| 21 | #define GUARD_TLATE_LIST_VALUE_HH |
|---|
| 22 | |
|---|
| 23 | #include "basic_sequential_value.hh" |
|---|
| 24 | #include <list> |
|---|
| 25 | |
|---|
| 26 | namespace tlate |
|---|
| 27 | { |
|---|
| 28 | class list_value : public basic_sequential_value< |
|---|
| 29 | std::list<value::const_ptr>, |
|---|
| 30 | value::const_ptr (*)(value::const_ptr)> |
|---|
| 31 | { |
|---|
| 32 | typedef basic_sequential_value< |
|---|
| 33 | std::list<value::const_ptr>, |
|---|
| 34 | value::const_ptr (*)(value::const_ptr)> base; |
|---|
| 35 | static value::const_ptr id(value::const_ptr v) { return v; } |
|---|
| 36 | public: |
|---|
| 37 | typedef boost::shared_ptr<list_value> ptr; |
|---|
| 38 | typedef boost::shared_ptr<const list_value> cconst_ptr; |
|---|
| 39 | list_value(std::list<value::const_ptr> list = |
|---|
| 40 | std::list<value::const_ptr>()) |
|---|
| 41 | : base(list, id) |
|---|
| 42 | {} |
|---|
| 43 | void push_back(value::const_ptr v) { get().push_back(v); } |
|---|
| 44 | bool empty() const { return get().empty(); } |
|---|
| 45 | }; |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | #endif |
|---|