mail[Wesnoth-commits] r29129 - in /trunk/src: config_cache.cpp config_cache.hpp


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

Header


Content

Posted by paniemin on August 31, 2008 - 02:58:
Author: suokko
Date: Sun Aug 31 02:58:43 2008
New Revision: 29129

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29129&view=rev
Log:
Fixing bind problems using boost lambda?

Modified:
    trunk/src/config_cache.cpp
    trunk/src/config_cache.hpp

Modified: trunk/src/config_cache.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config_cache.cpp?rev=29129&r1=29128&r2=29129&view=diff
==============================================================================
--- trunk/src/config_cache.cpp (original)
+++ trunk/src/config_cache.cpp Sun Aug 31 02:58:43 2008
@@ -26,6 +26,8 @@
 #include "serialization/binary_or_text.hpp"
 #include "serialization/parser.hpp"
 
+#include <boost/lambda/lambda.hpp>
+#include <boost/lambda/bind.hpp>
 #include <boost/bind.hpp>
 
 #define ERR_CACHE LOG_STREAM(err, cache)
@@ -264,7 +266,7 @@
                add_defines_map_diff(copy_map);
        }
 
-       void config_cache::add_define_from_file(const 
config::all_children_iterator::value_type& value)
+       void config_cache::add_define_from_file(const 
config::all_children_iterator::value_type value) const
        {
                config_cache_transaction::instance().insert_to_active(
                                preproc_define::read_pair(value.second));
@@ -272,6 +274,9 @@
 
        void config_cache::read_defines_file(const std::string& path)
        {
+               using namespace boost::lambda;
+               boost::lambda::placeholder1_type X;
+
                config cfg;
                read_file(path, cfg);
 
@@ -280,9 +285,9 @@
                // use static preproc_define::read_pair(config*) to make a 
object
                // and pass that object 
config_cache_transaction::insert_to_active method
                std::for_each(cfg.ordered_begin(), cfg.ordered_end(),
-                               
boost::bind(&config_cache::add_define_from_file,
+                               bind(&config_cache::add_define_from_file,
                                        this,
-                                       _1)
+                                       X)
                                );      
        }
 

Modified: trunk/src/config_cache.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config_cache.hpp?rev=29129&r1=29128&r2=29129&view=diff
==============================================================================
--- trunk/src/config_cache.hpp (original)
+++ trunk/src/config_cache.hpp Sun Aug 31 02:58:43 2008
@@ -98,7 +98,7 @@
                void read_configs(const std::string& path, config& cfg, 
preproc_map& defines);
                void load_configs(const std::string& path, config& cfg);
                void read_defines_queue();
-               void add_define_from_file(const 
config::all_children_iterator::value_type& value);
+               void add_define_from_file(const 
config::all_children_iterator::value_type value) const;
                void read_defines_file(const std::string& path);
 
                preproc_map& make_copy_map();




Related Messages


Powered by MHonArc, Updated Sun Aug 31 03:21:04 2008