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

Fix compilation of input_adapter(container) in edge cases #2553

Merged

Commits on Dec 28, 2020

  1. Fix compilation of input_adapter(container) in edge cases

    This fixes a compilation issue with the library if trying to use containers that
    don't have non-member `begin()` and `end()` functions via ADL.
    
    This patch extends the `using std::begin` and `using std::end` declarations to
    also cover the return type deduction of the input_adapter() template
    specialization for containers. The previous implementation only enabled the
    detection of `std::begin()` and `std::end()` in the function body, making the
    specialization unusable for container types that only have member `begin()` and
    `end()` functions.
    
    It is not typical to have `using` declarations in the namespace scope in a
    header file. But a C++11 implementation can't rely on fully automatic return
    type deduction, and needs to rely on ADL enabled helper templates. To prevent
    the using declarations leaking, they are enclosed in another nested namespace.
    jasujm committed Dec 28, 2020
    Configuration menu
    Copy the full SHA
    467f622 View commit details
    Browse the repository at this point in the history