Author: mordante
Date: Mon Nov 10 19:30:36 2008
New Revision: 30695

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30695&view=rev
Log:
Add extra comment, use end() for invalid iterator.

Modified:
    trunk/src/image.hpp

Modified: trunk/src/image.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/image.hpp?rev=30695&r1=30694&r2=30695&view=diff
==============================================================================
--- trunk/src/image.hpp (original)
+++ trunk/src/image.hpp Mon Nov 10 19:30:36 2008
@@ -42,10 +42,13 @@
 #else
        const int tile_size = 72;
 #endif
-       // Iterators from this dummy list are needed to ensure that iterator 
member of cache_item
-       // is always non-singular iterator thus avoiding
-       // "Copy-contruct from singular iterator" error
-       // when libstdc++ debug mode is enabled.
+       /**
+        * Iterators from this dummy list are needed to ensure that iterator 
member
+        * of cache_item is always non-singular iterator thus avoiding
+        * "Copy-contruct from singular iterator" error when libstdc++ debug 
mode
+        * is enabled. Note copying a singular iterator is undefined behaviour 
by
+        * the C++ standard.
+        */
        extern std::list<int> dummy_list;
 
        template<typename T>
@@ -53,14 +56,14 @@
                cache_item() : 
                        loaded(false), 
                        item() ,
-                       position(dummy_list.begin())
+                       position(dummy_list.end())
                {
                }
 
                cache_item(T item) : 
                        loaded(true), 
                        item(item),
-                       position(dummy_list.begin())
+                       position(dummy_list.end())
                {
                }
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to