There are still a few functions that only take raw char* pointers to null terminated buffers. This makes it hard for the C++ driver, since it often deals in string_views that aren't ensured to be null terminated. In those instances, we must construct a temporary std::string (with the associated heap allocation) from our string_view, and then pass those into the C driver, which then calls strlen on it.
A few functions known to have this issue, notably the bson_append family functions for dbpointer, code, codewscope, and regex. It also appears that the decimal128_[to,from]_string functions have this issue.
While it may not make sense to address this for the deprecated types, fixing it for at least regex and decimals seems worthwhile.
- is depended on by
-
CXX-1501 Use bson_append...w_len functions where applicable
- Closed
- related to
-
CDRIVER-2414 bson_iter{_init}_find should have length taking overloads
- Closed