diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-21 13:00:33 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-21 13:00:33 +0200 |
commit | a28444da4ca6adb016f719e032174ccb54e1692e (patch) | |
tree | 75fe8ceae2d20baa3d4b5375a832598efe8b2fce /odb/database.ixx | |
parent | 0046a34d5ad5fc1e88b33279605f179646b0ea59 (diff) |
Rework const object handling
Now objects are always loaded as non-const and the object cache in
session treats all objects as non-const.
Diffstat (limited to 'odb/database.ixx')
-rw-r--r-- | odb/database.ixx | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/odb/database.ixx b/odb/database.ixx index c4b3c77..7bc6520 100644 --- a/odb/database.ixx +++ b/odb/database.ixx @@ -167,66 +167,48 @@ namespace odb inline unsigned long long database:: erase_query () { - // T can be const T while object_type will always be T. + // T is always object_type. // - typedef typename odb::object_traits<T>::object_type object_type; - - return erase_query<T> (odb::query<object_type> ()); + return erase_query<T> (odb::query<T> ()); } template <typename T> inline unsigned long long database:: erase_query (const char* q) { - // T can be const T while object_type will always be T. + // T is always object_type. // - typedef typename odb::object_traits<T>::object_type object_type; - - return erase_query<T> (odb::query<object_type> (q)); + return erase_query<T> (odb::query<T> (q)); } template <typename T> inline unsigned long long database:: erase_query (const std::string& q) { - // T can be const T while object_type will always be T. + // T is always object_type. // - typedef typename odb::object_traits<T>::object_type object_type; - - return erase_query<T> (odb::query<object_type> (q)); + return erase_query<T> (odb::query<T> (q)); } template <typename T> inline result<T> database:: query (bool cache) { - // T can be const T. - // - typedef typename details::meta::remove_const<T>::result type; - - return query<T> (odb::query<type> (), cache); + return query<T> (odb::query<T> (), cache); } template <typename T> inline result<T> database:: query (const char* q, bool cache) { - // T can be const T. - // - typedef typename details::meta::remove_const<T>::result type; - - return query<T> (odb::query<type> (q), cache); + return query<T> (odb::query<T> (q), cache); } template <typename T> inline result<T> database:: query (const std::string& q, bool cache) { - // T can be const T. - // - typedef typename details::meta::remove_const<T>::result type; - - return query<T> (odb::query<type> (q), cache); + return query<T> (odb::query<T> (q), cache); } inline unsigned long long database:: |