aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-09-03 12:09:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-09-03 12:09:06 +0200
commit0d8fddcf11df9eb731f1abef070211b6c8733e8a (patch)
tree816489c0b6e10277df252610922190f83725f474
parent7b884d89ed25337ac9ad26487f89c750435472af (diff)
C++11 optimizations for Boost unordered containers sub-profile
-rw-r--r--odb/boost/unordered/container-traits.hxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/odb/boost/unordered/container-traits.hxx b/odb/boost/unordered/container-traits.hxx
index 6979ed7..49011eb 100644
--- a/odb/boost/unordered/container-traits.hxx
+++ b/odb/boost/unordered/container-traits.hxx
@@ -13,10 +13,13 @@
#include <odb/pre.hxx>
+#include <utility> // std::move
+
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <odb/container-traits.hxx>
+#include <odb/details/config.hxx> // ODB_CXX11
namespace odb
{
@@ -51,7 +54,11 @@ namespace odb
{
value_type v;
more = f.load_all (v);
+#ifdef ODB_CXX11
+ c.insert (std::move (v));
+#else
c.insert (v);
+#endif
}
}
@@ -107,7 +114,11 @@ namespace odb
{
value_type v;
more = f.load_all (v);
+#ifdef ODB_CXX11
+ c.insert (std::move (v));
+#else
c.insert (v);
+#endif
}
}
@@ -163,7 +174,12 @@ namespace odb
key_type k;
value_type v;
more = f.load_all (k, v);
+
+#ifdef ODB_CXX11
+ c.insert (pair_type (std::move (k), std::move (v)));
+#else
c.insert (pair_type (k, v));
+#endif
}
}
@@ -223,7 +239,12 @@ namespace odb
key_type k;
value_type v;
more = f.load_all (k, v);
+
+#ifdef ODB_CXX11
+ c.insert (pair_type (std::move (k), std::move (v)));
+#else
c.insert (pair_type (k, v));
+#endif
}
}