aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-28 14:36:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-28 14:36:11 +0200
commitccdf7823df5974f1f55c347d3bb8b23e7738b047 (patch)
treec920f2535c04f69bd36205f9c814cc93679c36f9
parentf5d79a0cd5dc12a430d17bbdca7ec5aacb45996c (diff)
Make sure underlying value is in default-constructed state if nullable is NULL
-rw-r--r--odb/nullable.hxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/odb/nullable.hxx b/odb/nullable.hxx
index 4b33564..0d5e46a 100644
--- a/odb/nullable.hxx
+++ b/odb/nullable.hxx
@@ -102,9 +102,7 @@ namespace odb
{
if (this != &y)
{
- if (!y.null_)
- value_ = y.value_;
-
+ value_ = y.value_;
null_ = y.null_;
}
@@ -116,9 +114,7 @@ namespace odb
inline nullable<T>& nullable<T>::
operator= (const nullable<Y>& y)
{
- if (!y.null_)
- value_ = y.value_;
-
+ value_ = y.value_;
null_ = y.null_;
return *this;
}
@@ -190,6 +186,7 @@ namespace odb
inline void nullable<T>::
reset ()
{
+ value_ = T ();
null_ = true;
}
}