Hello,

2012/5/19 Vadim Zeitlin <[email protected]>

> Below is an improved patch which does the same thing portably, it's based
> on the same idea as Michael Evdokimov's proposal in the above thread but
> not strictly identical to it.
>
> +// long must be mapped either to x_integer or x_long_long:
> +template<int long_size> struct long_traits_helper;
> +template<> struct long_traits_helper<4> { enum { x_type = x_integer }; };
> +template<> struct long_traits_helper<8> { enum { x_type = x_long_long };
> };
> +
>  template <>
>  struct exchange_traits<long int>
>  {
>     typedef basic_type_tag type_family;
> -    enum { x_type = x_integer };
> +    enum { x_type = long_traits_helper<sizeof(long int)>::x_type };
>  };
> -#endif // #if defined (__LP64__) || ( __WORDSIZE == 64 )
>
>  template <>
>  struct exchange_traits<double>
> --
>

That seems very elegant (and more robust) to me.
+1

Denis
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to