From ccdf7823df5974f1f55c347d3bb8b23e7738b047 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Aug 2011 14:36:11 +0200 Subject: Make sure underlying value is in default-constructed state if nullable is NULL --- odb/nullable.hxx | 9 +++------ 1 file 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& nullable:: operator= (const nullable& y) { - if (!y.null_) - value_ = y.value_; - + value_ = y.value_; null_ = y.null_; return *this; } @@ -190,6 +186,7 @@ namespace odb inline void nullable:: reset () { + value_ = T (); null_ = true; } } -- cgit v1.1