Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51594 - sandbox/reference_closure
From: dave_at_[hidden]
Date: 2009-03-03 21:54:00


Author: dave
Date: 2009-03-03 21:54:00 EST (Tue, 03 Mar 2009)
New Revision: 51594
URL: http://svn.boost.org/trac/boost/changeset/51594

Log:
Lambdas would be known to be trivially copiable

Updated timing record to include speed ratios

Text files modified:
   sandbox/reference_closure/timings.txt | 18 ++++++++++++++++++
   sandbox/reference_closure/trivial_closure.h | 14 ++++++++++++++
   2 files changed, 32 insertions(+), 0 deletions(-)

Modified: sandbox/reference_closure/timings.txt
==============================================================================
--- sandbox/reference_closure/timings.txt (original)
+++ sandbox/reference_closure/timings.txt 2009-03-03 21:54:00 EST (Tue, 03 Mar 2009)
@@ -10,6 +10,8 @@
 user 0m26.292s
 sys 0m0.056s
 
+t(std::function<>) / t(reference_closure): 22.7
+
 === Removed unrealistic indirection from lambda case ===
 
 execute trivial_nested
@@ -22,3 +24,19 @@
 user 0m27.443s
 sys 0m0.080s
 
+t(std::function<>) / t(reference_closure): 23.5
+
+=== Lambdas would be known to be trivially copiable ===
+
+execute trivial_nested
+real 0m1.175s
+user 0m1.166s
+sys 0m0.004s
+
+execute trivial_function
+real 0m4.871s
+user 0m4.836s
+sys 0m0.013s
+
+t(std::function<>) / t(reference_closure): 4.1
+

Modified: sandbox/reference_closure/trivial_closure.h
==============================================================================
--- sandbox/reference_closure/trivial_closure.h (original)
+++ sandbox/reference_closure/trivial_closure.h 2009-03-03 21:54:00 EST (Tue, 03 Mar 2009)
@@ -22,4 +22,18 @@
   void operator()() { work( scope ); }
 };
 
+#include <tr1/functional>
+namespace std
+{
+ namespace tr1
+ {
+
+ template <>
+ struct __is_location_invariant<lambda>
+ : integral_constant<bool,true>
+ {};
+
+ }
+}
+
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk