-
Notifications
You must be signed in to change notification settings - Fork 547
CXX-2745 add aliases and deprecations for v1 renames #1463
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
Relating to CXX-2118 (
It remains a mystery to me why |
Does changing the declaration to: enum v_noabi::type type() const; make the error go away? I couldn't repro your exact issue, but this works when the error is expected, e.g.: https://godbolt.org/z/xbhj39cfW |
…tibility" This reverts commit 8d24fd9.
Solved: it's apparently being caused by this stray unqualified Removing the ctor declaration or qualifying the declaration with |
Interestingly, I can repro similar errors on MSVC and Clang with some modifications:
|
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
/// | ||
/// Equivalent to @ref type() const. | ||
/// | ||
/// To support incremental migration to @ref bsoncxx::v1::types::view. |
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.
/// To support incremental migration to @ref bsoncxx::v1::types::view. | |
/// To support incremental migration to @ref bsoncxx::v1::types::value. |
Are the added type
, type_id
and get_<type>
methods intended for feature parity with bsoncxx::v1::types::value
? I expect this may not strictly be needed to ease migration since existing applications would not have calls to these methods.
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.
Not for feature parity, but for name parity, so that when root namespace redeclarations are updated from v_noabi
to v1
, the required changes can be minimized in advance by downstream users without forced-breaking-changes:
bsoncxx::types::view v; // Syntax is the same for v_noabi and v1.
v.type_view(); // Syntax is the same for v_noabi and v1.
When bsoncxx::types::view
is updated from v_noabi::types::view
to v1::types::view
, code which have already been incrementally updated (as part of a API minor version release) to use the new names will not be broken by the redeclaration release (as part of a API major version release) to the same extent as if the v_noabi new-name equivalents were not available.
Related to CXX-2745. A minor PR as followup to #1447 to improve the v_noabi -> v1 migration path for renamed entities by providing (and using) equivalent aliases in the current v_noabi API.
Every rename is accompanied by:
This permits users to easily switch to the renamed v_noabi equivalent without needing to deal with v_noabi vs. v1 relative breaking changes. Users who have switched to the renamed v_noabi equivalent will then be able to manually (via ABI namespace qualification) or automatically (via root namespace redeclaration updates) switch to the v1 equivalent. For example, the migration path for
v_noabi::types::bson_value::view
->v1::types::view
may look like:Without the renames introduced by this PR, the middle step is missing: users would have to jump straight from the old v_noabi name to the new v1 equivalent.
The renamed (deprecated) names may be removed in an upcoming API major release by moving the entity definitions into where the aliases/equivalents are currently declared or by dropping them entirely in favor of v1. Either approach will work depending on the timeline of events (does not need to be decided at this time).