From: Mateusz L. <ma...@lo...> - 2010-10-21 10:45:03
|
On 21/10/10 10:26, Henning Basold wrote: > Am 20.10.2010 19:02, schrieb Mateusz Loskot: >> On 20/10/10 17:08, Henning Basold wrote: >>> Hi, >>> >>> I've attached a patch which enables SOCI to supporte all Boost.Fusion >>> sequence types and not just fusion::vector. It is a relativ simple >>> patch. But it needs a small change (not breaking) in the >>> type_conversion interface. Maybe this can be worked around if needed. >>> >>> I would like to see this integrated into SOCI because it makes >>> adaption of UDT more convenient and also enables adaption of types >>> like std::pair just by including the appropriate Fusion headers. >> >> Hi Henning, >> >> First of all, thank you very much for the patch. >> >> Did you generated it using git format-patch utility? >> I'm having problems with applying it, it looks suspicious to me. >> >> Best regards, > > Hi, > > sorry for multiple postings. No problem, thanks for the contributions! > But I thought there should be a test case > and some documentation about it. So I amended this to the patch (see > attachment). I don't know how you write the documentation, so I just > hacked it into the HTML document. I'll take a look soonly. > The integration of arbitrary fusion sequences works by using SFINAE (the > new parameter to type_conversion). A specialization of type_conversion > is then enabled iff the parameter T models a fusion sequence. Then this > specialization just passes the parameter through to a conversion struct > which uses the correct number of entries in the passed sequence. The > same technique is used within Boost.Spirit. > Hope that is clear. Yes, it is clear. Generally, I like the idea of extending the support to other fusion containers and I'd like to integrate it. Yesterday, I tried to compile it and add some tests, but GCC 4.4 reported some compilation errors. It was late night, so I didn't try to investigate it. I will continue tonight. Here is your patch committed: http://soci.git.sourceforge.net/git/gitweb.cgi?p=soci/soci;a=commit;h=80642eac33a99a683a6f4db76d173178fb5935b1 I reverted until I have it working: http://soci.git.sourceforge.net/git/gitweb.cgi?p=soci/soci;a=commit;h=5f8871b1099b78bb67ed7c3c39bff37058ef9e9c Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org Member of ACCU, http://accu.org |