From b038ab0cd6335f3e4ec075d1e21f5d7bb89e3ffb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Jul 2011 13:42:18 +0200 Subject: New design for NULL semantics Now, instead of being specified as part of the SQL type with the type pragma, there are separate null and not_null pragmas. The not_null pragma was used to control NULL-ness of object pointers. Now the two pragmas are used consistently for object pointers and simple values (and in the future will work for composite values and containers). --- common/relationship/driver.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/relationship') diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index abbae29..3ce7e8c 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -46,8 +46,9 @@ main (int argc, char* argv[]) a.v1.push_back (0); a.v1.push_back (new obj1 ("v1 2", "v1 2")); + // Set cannot contain NULL pointers. + // a.s1.insert (new obj1 ("s1 0", "s1 0")); - a.s1.insert (static_cast (0)); // VC 10 a.s1.insert (new obj1 ("s1 2", "s1 2")); a.m1[0] = new obj1 ("m1 0", "m1 0"); @@ -112,7 +113,7 @@ main (int argc, char* argv[]) t.commit (); } - // test NULL pointer + // Test NULL pointer. // delete a.o1; a.o1 = 0; -- cgit v1.1