Author: wyoung
Date: Thu Dec 4 23:15:48 2008
New Revision: 2433
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2433&view=rev
Log:
Null::operator Type() now returns by-value instead of by-reference,
allowing it to be const. This allows you to use nullable types in const
context. It was no doubt the way it was because ColData didn't have
copy by reference. Since moving to String, the justification goes away.
Modified:
trunk/lib/null.h
Modified: trunk/lib/null.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/null.h?rev=2433&r1=2432&r2=2433&view=diff
==============================================================================
--- trunk/lib/null.h (original)
+++ trunk/lib/null.h Thu Dec 4 23:15:48 2008
@@ -224,12 +224,14 @@
/// this template. See NullIsNull, NullIsZero and NullIsBlank.
///
/// Otherwise, just returns the 'data' member.
- operator Type&()
- {
- if (is_null)
- return data = Behavior::null_is();
- else
+ operator Type() const
+ {
+ if (is_null) {
+ return Behavior::null_is();
+ }
+ else {
return data;
+ }
}
/// \brief Assign a value to the object.
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits