Details
-
Improvement
-
Resolution: Known Error
-
Minor
-
None
-
None
-
None
-
None
-
1
Description
We use Couchbase C client library from code written in C++ but it seems that public header files are C code. Is there a way to access C++ bits written in libcouchbase library, in particular the C++ class lcb_CMDSTORE (treated as opaque type from current header files as far as I can see). Reason for this is to eventually reduce memory allocations in following snippet code:
lcb_CMDSTORE* scmd;
// allocate lcb_CMDSTORE using new operator.
lcb_cmdstore_create(&scmd, authoritative ? LCB_STORE_UPSERT : LCB_STORE_INSERT);
// Key.
// key value allocated and copied via std::string constructor. Would rather take a std::string&& and move data.
lcb_cmdstore_key(scmd, id.data(), id.size());
// Value.
// Value allocated and copied via std::string constructor. Would rather take a std::string&& and move data.
lcb_cmdstore_value(scmd, document.data(), document.size());
Hope it makes sense, thanks in advance.
Attachments
Issue Links
- depends on
-
CCBC-1471 Reduce allocation when crossing C/C++ API boundary
- Closed