-
Notifications
You must be signed in to change notification settings - Fork 543
CXX-3082 Add examples for bsoncxx::v_noabi::builder::concatenate #1224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the readability improvement of using make_array
. Suggested rewording concatenate docs.
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with other two comments updated.
/// Use this with a document or array builder to merge an existing document's fields with that of | ||
/// the document or array being built. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Use this with a document or array builder to merge an existing document's fields with that of | |
/// the document or array being built. | |
/// Use this with a document builder to merge an existing document's fields with that of the | |
/// document being built. |
/// Use this with a document or array builder to merge an existing array's fields with that of the | ||
/// document or array being built. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Use this with a document or array builder to merge an existing array's fields with that of the | |
/// document or array being built. | |
/// Use this with an array builder to merge an existing array's fields with that of the array being | |
/// built. |
Followup to #1208. Prompted by CXX-2291.
Overlooked the addition of examples of using
concatenate()
, which are currently only used in error handling examples for sub-document/sub-array exception recovery. Updates documentation ofconcatenate()
overloads to avoid implying their use is specific to the stream builders.As a drive-by improvement, simplifies creation of arrays for examples by using
make_array(args...)
instead of going throughfrom_json(R"({"v": [args...]})")["v"].get_array().value
. ("When all you have is a hammer, ...")