aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE2
-rw-r--r--manifest6
-rw-r--r--odb/database.hxx2
-rw-r--r--odb/details/function-wrapper.txx5
-rw-r--r--odb/details/transfer-ptr.hxx2
-rw-r--r--odb/details/unique-ptr.hxx4
-rw-r--r--odb/lazy-ptr-impl.hxx8
-rw-r--r--odb/lazy-ptr-impl.ixx8
-rw-r--r--odb/lazy-ptr.hxx8
-rw-r--r--odb/lazy-ptr.ixx8
-rw-r--r--odb/vector-impl.hxx4
-rw-r--r--odb/vector-impl.ixx53
-rw-r--r--odb/vector.hxx8
-rw-r--r--odb/version-build2.hxx.in2
-rw-r--r--odb/version.hxx8
-rw-r--r--version.txt2
16 files changed, 74 insertions, 56 deletions
diff --git a/LICENSE b/LICENSE
index 0cffa09..9d92da1 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009-2022 Code Synthesis Tools CC.
+Copyright (c) 2009-2024 Code Synthesis Tools CC.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
diff --git a/manifest b/manifest
index 6651b53..d728912 100644
--- a/manifest
+++ b/manifest
@@ -1,6 +1,6 @@
: 1
name: libodb
-version: 2.5.0-b.24.z
+version: 2.5.0-b.26.z
project: odb
summary: Common ODB runtime library
license: GPL-2.0-only
@@ -15,5 +15,5 @@ email: odb-users@codesynthesis.com
build-warning-email: odb-builds@codesynthesis.com
builds: all
requires: c++11
-depends: * build2 >= 0.15.0-
-depends: * bpkg >= 0.15.0-
+depends: * build2 >= 0.16.0-
+depends: * bpkg >= 0.16.0-
diff --git a/odb/database.hxx b/odb/database.hxx
index 485cf52..e18e8ee 100644
--- a/odb/database.hxx
+++ b/odb/database.hxx
@@ -48,6 +48,8 @@ namespace odb
#ifdef ODB_CXX11
//database (database&&) = default; // VC 2013
+ // Note: noexcept is not specified since *_map_ (std::map) can throw.
+ //
database (database&& d)
: id_ (d.id_),
tracer_ (d.tracer_),
diff --git a/odb/details/function-wrapper.txx b/odb/details/function-wrapper.txx
index 19e4cbc..db73e8d 100644
--- a/odb/details/function-wrapper.txx
+++ b/odb/details/function-wrapper.txx
@@ -67,7 +67,10 @@ namespace odb
}
else
{
- function = reinterpret_cast<F*> (&caller_impl<F>::function);
+ function_wrapper<decltype (caller_impl<F>::function)> fw (
+ &caller_impl<F>::function);
+
+ function = fw.template cast<F*> ();
deleter = &deleter_impl<F>;
std_function = new std_function_type (std::move (sf));
}
diff --git a/odb/details/transfer-ptr.hxx b/odb/details/transfer-ptr.hxx
index 2ee0752..4b63df6 100644
--- a/odb/details/transfer-ptr.hxx
+++ b/odb/details/transfer-ptr.hxx
@@ -49,7 +49,7 @@ namespace odb
transfer_ptr& operator= (const transfer_ptr&);
public:
- transfer_ptr (transfer_ptr&& p): p_ (p.transfer ()) {}
+ transfer_ptr (transfer_ptr&& p) noexcept: p_ (p.transfer ()) {}
#endif
~transfer_ptr () {delete p_;}
diff --git a/odb/details/unique-ptr.hxx b/odb/details/unique-ptr.hxx
index 6663c30..06b2c76 100644
--- a/odb/details/unique-ptr.hxx
+++ b/odb/details/unique-ptr.hxx
@@ -22,8 +22,8 @@ namespace odb
~unique_ptr () {delete p_;}
#ifdef ODB_CXX11
- unique_ptr (unique_ptr&& p): p_ (p.p_) {p.p_ = 0;}
- unique_ptr& operator= (unique_ptr&& p)
+ unique_ptr (unique_ptr&& p) noexcept: p_ (p.p_) {p.p_ = 0;}
+ unique_ptr& operator= (unique_ptr&& p) noexcept
{
if (this != &p)
{
diff --git a/odb/lazy-ptr-impl.hxx b/odb/lazy-ptr-impl.hxx
index 83d6011..89fe798 100644
--- a/odb/lazy-ptr-impl.hxx
+++ b/odb/lazy-ptr-impl.hxx
@@ -44,10 +44,10 @@ namespace odb
//
public:
#ifdef ODB_CXX11
- lazy_ptr_base (lazy_ptr_base&&);
+ lazy_ptr_base (lazy_ptr_base&&) noexcept;
lazy_ptr_base&
- operator= (lazy_ptr_base&&);
+ operator= (lazy_ptr_base&&) noexcept;
#endif
public:
@@ -139,13 +139,13 @@ namespace odb
//
public:
#ifdef ODB_CXX11
- lazy_ptr_impl (lazy_ptr_impl&&);
+ lazy_ptr_impl (lazy_ptr_impl&&) noexcept;
template <typename Y>
lazy_ptr_impl (lazy_ptr_impl<Y>&&);
lazy_ptr_impl&
- operator= (lazy_ptr_impl&&);
+ operator= (lazy_ptr_impl&&) noexcept;
template <typename Y>
lazy_ptr_impl&
diff --git a/odb/lazy-ptr-impl.ixx b/odb/lazy-ptr-impl.ixx
index 7843dc9..9ab0471 100644
--- a/odb/lazy-ptr-impl.ixx
+++ b/odb/lazy-ptr-impl.ixx
@@ -31,7 +31,7 @@ namespace odb
#ifdef ODB_CXX11
inline lazy_ptr_base::
- lazy_ptr_base (lazy_ptr_base&& r)
+ lazy_ptr_base (lazy_ptr_base&& r) noexcept
: id_ (r.id_), db_ (r.db_), loader_ (r.loader_),
free_ (r.free_), copy_ (r.copy_)
{
@@ -78,7 +78,7 @@ namespace odb
#ifdef ODB_CXX11
inline lazy_ptr_base& lazy_ptr_base::
- operator= (lazy_ptr_base&& r)
+ operator= (lazy_ptr_base&& r) noexcept
{
if (id_ != r.id_)
{
@@ -272,7 +272,7 @@ namespace odb
#ifdef ODB_CXX11
template <typename T>
inline lazy_ptr_impl<T>::
- lazy_ptr_impl (lazy_ptr_impl&& r)
+ lazy_ptr_impl (lazy_ptr_impl&& r) noexcept
: lazy_ptr_base (std::move (r))
{
}
@@ -287,7 +287,7 @@ namespace odb
template <typename T>
inline lazy_ptr_impl<T>& lazy_ptr_impl<T>::
- operator= (lazy_ptr_impl&& r)
+ operator= (lazy_ptr_impl&& r) noexcept
{
lazy_ptr_base& b (*this);
b = std::move (r);
diff --git a/odb/lazy-ptr.hxx b/odb/lazy-ptr.hxx
index ae2b43c..ab31dfc 100644
--- a/odb/lazy-ptr.hxx
+++ b/odb/lazy-ptr.hxx
@@ -246,14 +246,14 @@ namespace odb
lazy_unique_ptr (pointer, const deleter_type&) /*noexcept*/;
lazy_unique_ptr (pointer, deleter_type&&) /*noexcept*/;
- lazy_unique_ptr (lazy_unique_ptr&&) /*noexcept*/;
+ lazy_unique_ptr (lazy_unique_ptr&&) noexcept;
template <class T1, class D1> lazy_unique_ptr (lazy_unique_ptr<T1, D1>&&) /*noexcept*/;
//template <class T1> lazy_unique_ptr (std::auto_ptr<T1>&&) /*noexcept*/;
#ifdef ODB_CXX11_NULLPTR
lazy_unique_ptr& operator= (std::nullptr_t) /*noexcept*/;
#endif
- lazy_unique_ptr& operator= (lazy_unique_ptr&&) /*noexcept*/;
+ lazy_unique_ptr& operator= (lazy_unique_ptr&&) noexcept;
template <class T1, class D1> lazy_unique_ptr& operator= (lazy_unique_ptr<T1, D1>&&) /*noexcept*/;
T& operator* () const;
@@ -407,7 +407,7 @@ namespace odb
lazy_shared_ptr (const lazy_shared_ptr&) /*noexcept*/;
template <class Y> lazy_shared_ptr (const lazy_shared_ptr<Y>&) /*noexcept*/;
- lazy_shared_ptr (lazy_shared_ptr&&) /*noexcept*/;
+ lazy_shared_ptr (lazy_shared_ptr&&) noexcept;
template <class Y> lazy_shared_ptr (lazy_shared_ptr<Y>&&) /*noexcept*/;
template <class Y> explicit lazy_shared_ptr (const lazy_weak_ptr<Y>&);
//template <class Y> explicit lazy_shared_ptr (std::auto_ptr<Y>&&);
@@ -417,7 +417,7 @@ namespace odb
lazy_shared_ptr& operator= (const lazy_shared_ptr&) /*noexcept*/;
template <class Y> lazy_shared_ptr& operator= (const lazy_shared_ptr<Y>&) /*noexcept*/;
- lazy_shared_ptr& operator= (lazy_shared_ptr&&) /*noexcept*/;
+ lazy_shared_ptr& operator= (lazy_shared_ptr&&) noexcept;
template <class Y> lazy_shared_ptr& operator= (lazy_shared_ptr<Y>&&) /*noexcept*/;
//template <class Y> lazy_shared_ptr& operator= (std::auto_ptr<Y>&&);
template <class Y, class D> lazy_shared_ptr& operator= (std::unique_ptr<Y, D>&&);
diff --git a/odb/lazy-ptr.ixx b/odb/lazy-ptr.ixx
index 647db83..a2d72f5 100644
--- a/odb/lazy-ptr.ixx
+++ b/odb/lazy-ptr.ixx
@@ -519,7 +519,7 @@ namespace odb
template <class T, class D>
lazy_unique_ptr<T, D>::
- lazy_unique_ptr (lazy_unique_ptr&& r)
+ lazy_unique_ptr (lazy_unique_ptr&& r) noexcept
: p_ (std::move (r.p_)), i_ (std::move (r.i_)) {}
template <class T, class D>
@@ -545,7 +545,7 @@ namespace odb
template <class T, class D>
lazy_unique_ptr<T, D>& lazy_unique_ptr<T, D>::
- operator= (lazy_unique_ptr&& r)
+ operator= (lazy_unique_ptr&& r) noexcept
{
p_ = std::move (r.p_);
i_ = std::move (r.i_);
@@ -922,7 +922,7 @@ namespace odb
template <class T>
inline lazy_shared_ptr<T>::
- lazy_shared_ptr (lazy_shared_ptr&& r)
+ lazy_shared_ptr (lazy_shared_ptr&& r) noexcept
: p_ (std::move (r.p_)), i_ (std::move (r.i_)) {}
template <class T>
@@ -979,7 +979,7 @@ namespace odb
template <class T>
inline lazy_shared_ptr<T>& lazy_shared_ptr<T>::
- operator= (lazy_shared_ptr&& r)
+ operator= (lazy_shared_ptr&& r) noexcept
{
p_ = std::move (r.p_);
i_ = std::move (r.i_);
diff --git a/odb/vector-impl.hxx b/odb/vector-impl.hxx
index 5189395..9f2ea7c 100644
--- a/odb/vector-impl.hxx
+++ b/odb/vector-impl.hxx
@@ -45,7 +45,7 @@ namespace odb
vector_impl (const vector_impl&);
#ifdef ODB_CXX11
- vector_impl (vector_impl&&);
+ vector_impl (vector_impl&&) noexcept;
#endif
void
@@ -195,7 +195,7 @@ namespace odb
vector_base (const vector_base&);
#ifdef ODB_CXX11
- vector_base (vector_base&&);
+ vector_base (vector_base&&) noexcept;
#endif
void
diff --git a/odb/vector-impl.ixx b/odb/vector-impl.ixx
index 3377cb8..21999d5 100644
--- a/odb/vector-impl.ixx
+++ b/odb/vector-impl.ixx
@@ -18,9 +18,19 @@ namespace odb
{
}
+ inline void vector_impl::
+ swap (vector_impl& x)
+ {
+ std::swap (state_, x.state_);
+ std::swap (size_, x.size_);
+ std::swap (tail_, x.tail_);
+ std::swap (capacity_, x.capacity_);
+ std::swap (data_, x.data_);
+ }
+
#ifdef ODB_CXX11
inline vector_impl::
- vector_impl (vector_impl&& x)
+ vector_impl (vector_impl&& x) noexcept
: state_ (state_not_tracking),
size_ (0), tail_ (0), capacity_ (0), data_ (0)
{
@@ -36,16 +46,6 @@ namespace odb
}
inline void vector_impl::
- swap (vector_impl& x)
- {
- std::swap (state_, x.state_);
- std::swap (size_, x.size_);
- std::swap (tail_, x.tail_);
- std::swap (capacity_, x.capacity_);
- std::swap (data_, x.data_);
- }
-
- inline void vector_impl::
reserve (std::size_t n)
{
if (n > capacity_)
@@ -146,6 +146,17 @@ namespace odb
inline vector_base::
vector_base (): tran_ (0) {}
+ inline void vector_base::
+ _arm (transaction& t) const
+ {
+ tran_ = &t;
+ t.callback_register (&rollback,
+ const_cast<vector_base*> (this),
+ transaction::event_rollback,
+ 0,
+ &tran_);
+ }
+
inline vector_base::
vector_base (const vector_base& x)
: impl_ (x.impl_), tran_ (0)
@@ -167,12 +178,19 @@ namespace odb
#ifdef ODB_CXX11
inline vector_base::
- vector_base (vector_base&& x)
+ vector_base (vector_base&& x) noexcept
: impl_ (std::move (x.impl_)), tran_ (0)
{
if (x.tran_ != 0)
{
x.tran_->callback_unregister (&x);
+
+ // Note that _arm() can potentially throw bad_alloc while adding a new
+ // callback to the callbacks list of the transaction object. However, we
+ // assume that this will not happen since the new callback should be
+ // saved into an existing slot, freed by the above callback_unregister()
+ // call.
+ //
_arm (*x.tran_);
}
}
@@ -189,15 +207,4 @@ namespace odb
{
return impl_.tracking ();
}
-
- inline void vector_base::
- _arm (transaction& t) const
- {
- tran_ = &t;
- t.callback_register (&rollback,
- const_cast<vector_base*> (this),
- transaction::event_rollback,
- 0,
- &tran_);
- }
}
diff --git a/odb/vector.hxx b/odb/vector.hxx
index ac75ef1..3fe7d8a 100644
--- a/odb/vector.hxx
+++ b/odb/vector.hxx
@@ -91,10 +91,16 @@ namespace odb
{return v_.get_allocator ();}
#ifdef ODB_CXX11
- vector(vector&& x): vector_base (std::move (x)), v_ (std::move (x.v_)) {}
+ vector(vector&& x) noexcept
+ : vector_base (std::move (x)), v_ (std::move (x.v_)) {}
+
vector(const vector& x, const A& a): vector_base (x), v_ (x.v_, a) {}
vector(vector&& x, const A& a)
: vector_base (std::move (x)), v_ (std::move (x.v_), a) {}
+
+ // Note: noexcept is not specified since it can throw while reallocating
+ // impl_.
+ //
vector& operator=(vector&&);
#ifdef ODB_CXX11_INITIALIZER_LIST
vector(std::initializer_list<T> il, const A& a = A()): v_ (il, a) {}
diff --git a/odb/version-build2.hxx.in b/odb/version-build2.hxx.in
index 8910012..3672585 100644
--- a/odb/version-build2.hxx.in
+++ b/odb/version-build2.hxx.in
@@ -5,7 +5,7 @@
// For the ODB compiler (temporary).
//
-#define ODB_VERSION 20474
+#define ODB_VERSION 20476
// The numeric version format is AAAAABBBBBCCCCCDDDE where:
//
diff --git a/odb/version.hxx b/odb/version.hxx
index 25ab2a9..4961e1a 100644
--- a/odb/version.hxx
+++ b/odb/version.hxx
@@ -29,13 +29,13 @@
// ODB interface version: minor, major, and alpha/beta versions.
//
-#define ODB_VERSION 20474
-#define ODB_VERSION_STR "2.5-b.24"
+#define ODB_VERSION 20476
+#define ODB_VERSION_STR "2.5-b.26"
// libodb version: interface version plus the bugfix version.
//
-#define LIBODB_VERSION 2049974
-#define LIBODB_VERSION_STR "2.5.0-b.24"
+#define LIBODB_VERSION 2049976
+#define LIBODB_VERSION_STR "2.5.0-b.26"
#include <odb/post.hxx>
diff --git a/version.txt b/version.txt
index cd2d927..6bc2f39 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-2.5.0-b.24
+2.5.0-b.26