Skip to content
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

LWG 3158 issue addressed #195

Merged
merged 3 commits into from
Oct 23, 2019
Merged

Conversation

NathanSWard
Copy link
Contributor

Description

Add a conditional explicit to std::tuple::tuple(std::allocator_arg_t, const Alloc&).
Fixes issue #69

Checklist

  • I understand README.md. I also understand that acceptance of
    community PRs will be delayed until the test and CI systems are online.
  • If this is a feature addition, that feature has been voted into the
    C++ Working Draft.
    I believe this is a bugfix, not a feature.
  • Identifiers in product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 .
  • The STL builds successfully and all tests have passed (must be manually
    verified by an STL maintainer before CI is online, leave this unchecked for
    initial submission).
  • These changes introduce no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate
    or trivially copyable, etc.).
  • These changes were written from scratch using only this repository and
    the C++ Working Draft as a reference (and any other cited standards).
    If they were derived from a project that's already listed in NOTICE.txt,
    that's fine, but please mention it. If they were derived from any other
    project (including Boost and libc++, which are not yet listed in
    NOTICE.txt), you must mention it here, so we can determine whether the
    license is compatible and what else needs to be done.

@NathanSWard NathanSWard requested a review from a team as a code owner October 19, 2019 18:40
@NathanSWard
Copy link
Contributor Author

Here is an example test case.

#include <tuple>
#include <memory>

struct implicit_t {
    implicit_t() = default;
};

struct explicit_t {
    explicit explicit_t() {}
};

int main() {
    std::tuple<implicit_t> tpl = {std::allocator_arg, std::allocator<implicit_t>{}};
    // std::tuple<explicit_t> tpl = {std::allocator_arg, std::allocator<explicit_t>{}}; <- should not compile
}

stl/inc/tuple Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

stl/inc/tuple Outdated Show resolved Hide resolved
@NathanSWard
Copy link
Contributor Author

NathanSWard commented Oct 19, 2019

Note on the force push:
Had an unnecessary additional conjunction in the explicit's enable_if_t which I removed.

Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect. (And today I learned that a review comment saying /azp run doesn't do anything, it has to be a separate comment.)

@StephanTLavavej
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephanTLavavej StephanTLavavej changed the title LWG 3158 issue addresses LWG 3158 issue addressed Oct 20, 2019
Copy link
Member

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good with test coverage.

@StephanTLavavej StephanTLavavej merged commit a7d9526 into microsoft:master Oct 23, 2019
@NathanSWard NathanSWard deleted the LWG_3158 branch October 23, 2019 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants