Boost logo

Boost Users :

Subject: Re: [Boost-users] [Q] serializing Database Null values (design question)
From: joel (joel.falcou_at_[hidden])
Date: 2009-06-20 01:57:08


V S P wrote:
> I have my CPP ORM pretty much working
>
> (so that I can read data from the database and serialize it with boost
> serialize)
> in generic manner.
>
> There is an issue however with 'Nulls' that possibly exist in the
> database.
>
> I use underneath OTL c++ db library and it has a 'null indicator' like
> many db libraries do.
>
> So if I see a value where null indicator is set to true, should I
> serialize it out
> and if yes -- is there something like 'NaN' for all the different value
> types defined?
>
What about using boost::optional to hold the value and serialize it ?
IIRC serialization of empty optional should work properly.

-- 
___________________________________________
Joel Falcou - Assistant Professor
PARALL Team - LRI - Universite Paris Sud XI
Tel : (+33)1 69 15 66 35

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net