On Friday 15 January 2010 16:33:26 Maciej Sobczak wrote:
> namespace soci
> {
> template <>
> struct type_conversion<unsigned int>
> {
> typedef long long base_type;
>
> static void from_base(long long from, indicator ind, unsigned
> int & to)
> {
> if (ind == i_null)
> {
> throw soci_error("Null value not allowed for this type");
> }
>
> to = static_cast<unsigned int>(from);
> }
>
> static void to_base(const unsigned int & from, long long & to,
> indicator & ind)
> {
> to = static_cast<long long>(from);
> ind = i_ok;
> }
> };
> }
>
> Please try to add this to your code.
> I see no reason why it would not work.
It works with postgresql.
Funny thing is (just noticed while experiementing), postgresql integer and
serial have same upper limit. Serials are just enforced to be positive. So
this whole signed-vs-unsigned debate just became meaningless for postgresql,
unless I create a custom type to support unsigned int.
does it make any difference for soci if I use int64_t instead of long long? I
just prefer it being bit more deterministic.
--
Shridhar
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users