mail[Wesnoth-commits] r33871 - /trunk/src/config.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on March 20, 2009 - 08:06:
Author: silene
Date: Fri Mar 20 08:06:36 2009
New Revision: 33871

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33871&view=rev
Log:
Added conversion from child_iterator to const_child_iterator.

Modified:
    trunk/src/config.hpp

Modified: trunk/src/config.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config.hpp?rev=33871&r1=33870&r2=33871&view=diff
==============================================================================
--- trunk/src/config.hpp (original)
+++ trunk/src/config.hpp Fri Mar 20 08:06:36 2009
@@ -67,6 +67,8 @@
        typedef std::vector<config*> child_list;
        typedef std::map<std::string,child_list> child_map;
 
+       struct const_child_iterator;
+
        struct child_iterator
        {
                typedef config value_type;
@@ -88,6 +90,7 @@
 
        private:
                Itor i_;
+               friend struct const_child_iterator;
        };
 
        struct const_child_iterator
@@ -99,6 +102,7 @@
                typedef const config &reference;
                typedef child_list::const_iterator Itor;
                explicit const_child_iterator(Itor i = Itor()): i_(i) {}
+               const_child_iterator(const child_iterator &i): i_(i.i_) {}
 
                const_child_iterator &operator++() { ++i_; return *this; }
                const_child_iterator operator++(int) { return 
const_child_iterator(i_++); }




Related Messages


Powered by MHonArc, Updated Fri Mar 20 08:20:31 2009