From: Warren Young Date: November 7 2005 8:03pm Subject: Re: Mysql++ and stl bitset class. List-Archive: http://lists.mysql.com/plusplus/5108 Message-Id: <436FB2F4.4020509@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jonatan Taminau wrote: > > However, I should be able to do this in a more performant way without the > 'string-conversion'. How many bits do you have? If it is less than or equal to the size in bits of your platform's unsigned long type, the solution is easy: use bitset::to_ulong(), and just store the value in an integer column. If it is more than that, you will have a much slower solution (though faster than to_string()). You will have to use count() and iterate over the "container" calling test() on each bit to construct your own binary representation. There seems to be no direct way to extract the data in the internal binary representation; this is probably A Feature (TM). To keep this relevant to the mailing list, I invite you to work out an adapter of some sort to do it both ways, for use with MySQL++'s SSQLS feature. Good luck with this new project you've volunteered for. We're all rooting for you. :)