[Monetdb-developers] Mapi query parameter constness
Dear MonetDB developers, as I have been working on interfacing Mapi to C++ in a manner as lightweight as possible, I have noticed that the parameter binding interface does not interface to STL strings as seamlessly as it probably could. Similar considerations might well apply to other C-based string APIs: The STL string API provides accessor functions to the string's char data and its size. To ensure secure programming, the pointer to the char data has to be const. Yet, the Mapi interface for passing string parameters expects a writable char pointer. I'm not sure how future plans for Mapi look like, but currently thsi doesn't seem necessary to me. I have attached a patch to have Mapi treat the data as const, which works well for me. I also noticed that Mapi expects the string size parameter to be passed by reference. Is this necessary? Having an interface which supports pass-by-value would facilitate string API integration even more. Best regards, Isidor
participants (1)
-
Isidor Zeuner