On 15.01.2010 13:03, Maciej Sobczak wrote:
>> 2) What brakes if we add such mapping in a whole?
> 
> It will be more work to implement (and test) new backends as there will 
> be more types to cover. This is what I would like to avoid.
> 

    In all backends each type require 4 lines of dumb code in average to map 
and another 4 to unmap. 
A little bit more to vectorized types. Code doesn't require any magic knowledge 
to support it and 
can be supported by anybody because of it extreme simplicity.
    Testing done by one test for all backends. And I don't think that it 
somehow complicated than 
signed version.
    Yes, it is little (really little) more work to do for backenders, but... as 
I can see SOCI 
shrinks not growing... And I don't see any meanfull reason for backend writers 
to resist such 
additions, that can be done in a minutes.

>> 3) Can it be implemented for existing backends?
> 
> I think so.
> 
> But I also have a question:
> 
> Can it be implemented in terms of user conversions?

    Surely it can. That obvious.

> Typing from my head, code was not tested:
> Please try to add this to your code.
> I see no reason why it would not work.

   Of course it works.
> 
>>     I can just implement stupid type_conversion for this mapping and be 
>> happy. But why this mapping 
>> can't live in library directly?
> 
> It can, just as there is such a mapping for boost::optional.
> But this approach is completely different from extending the type 
> mapping in the library and generating more work in all backends.
> 
> The existing types allow to accommodate your request and that's why 
> there is no reason to modify the library.

   If you reread my emails you don't find any one where I tell you HOW to 
support unsigned types. 
You may found that I request:

             Support unsigned int and unsigned short as first class citizen.

Thats all!!!

I wanna write

#include <soci/soci.h>

int main()
{
    ....
    unsigned int foo;
    db << "select foo from bar limit 1;", into(foo);
    cout << "Foo is << foo << "\n";
}

and that must work out-of-the-box.


------------------------------------------------------------------------------
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

Reply via email to