Koen Deforche wrote: > It think it's okay to do it -- it's just an additional copy operation.
Hi, I think it means creating and destroying a temporary object (vector) for each operation, doesn't it ? > That would be possible too -- provided we can solve memory management > so that the backend remains responsible for the memory allocated for a > returned blob value of unknown size, or copies the blob into a > preallocated array in case the size is fixed. This will complicate > backend design a bit since he will need to keep track of returned > blobs until the statement is reset or the next row is fetched. If you can't return the backend data to the caller to allow it to resize the object (presumably because the data will become unavailable after the return), the then about the only option is to pass in a callback of some type (interface class to abstract the resize ?) to the backend, rather than relying on it being vector<unsigned char>. Messy in it's own way, but would save creating the temporary vector<> and copying data in and out of it for any sort of fixed sized or resizable object. > Actually, you should be able to specialize this as: > > template <std::size_t N> > struct sql_value_traits<(unsigned char &)[N], void> { ... } I was wondering if this was possible, but my understanding of template syntax is sketchy. If I try implementing it along the lines above I get the (usual screen filling cascade of almost indecipherable error messages that result from any template problem), ending in: /Wt/Dbo/Field_impl.h:61: error: 'read' is not a member of 'Wt::Dbo::sql_value_traits< unsigned char [32], void>' /Wt/Dbo/Field_impl.h:42: error: 'type' is not a member of 'Wt::Dbo::sql_value_traits< unsigned char [32], void>' /Wt/Dbo/Field_impl.h:54: error: invalid conversion from 'unsigned char*' to 'const char*' /Wt/Dbo/Field_impl.h:54: error: initializing argument 1 of 'static void Wt::Dbo::sq l_value_traits<V, Enable>::bind(const char*, Wt::Dbo::SqlStatement*, int, int) [with V = unsigned char [32], Enable = void]' but maybe I messed up the implementation. cheers, Graeme Gill. ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest