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

Use View instead of Iterator + size #1250

Merged
merged 6 commits into from Nov 3, 2023
Merged

Conversation

autoantwort
Copy link
Contributor

No description provided.

include/vcpkg/base/parallel-algorithms.h Outdated Show resolved Hide resolved
src/vcpkg/postbuildlint.cpp Outdated Show resolved Hide resolved
include/vcpkg/base/parallel-algorithms.h Outdated Show resolved Hide resolved
@BillyONeal
Copy link
Member

This is technically a loss of functionality, as the previous code works with arbitrary ranits but this requires contiguous. I'm strongly Neutral on that so going to ask other maintainers.

@BillyONeal BillyONeal added the requires:discussion This PR requires discussion of the correct way forward label Oct 27, 2023
Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

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

Comparing to

void set_duplicates(FwdIt first, FwdIt last, OutIt out, Cmp cmp)

// the output range out.
template<class Container, class OutIt, class Cmp>
void set_duplicates(const Container& container, OutIt out, Cmp cmp)
{
    auto first = container.begin();
    const auto last = container.end();
    // as before

template<class Container, class OutIt>
void set_duplicates(const Container& container, OutIt out)
{
    return set_duplicates(container, out, std::less<>{});
}

Poll: We like this form over what's written?

@ras0219-msft Yes
@JavierMatosD Yes
@vicroms Yes
@BillyONeal No (but ate standard library code for breakfast for 5 years)
@data-queue No preference.

@ras0219-msft specifically asked for Container&& rather than View to avoid needing to name T at the call site.

include/vcpkg/base/parallel-algorithms.h Outdated Show resolved Hide resolved
@BillyONeal BillyONeal removed the requires:discussion This PR requires discussion of the correct way forward label Nov 2, 2023
@BillyONeal BillyONeal merged commit 0039471 into microsoft:main Nov 3, 2023
5 checks passed
@BillyONeal
Copy link
Member

Thanks!

@autoantwort autoantwort deleted the use-view branch November 3, 2023 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants