Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
J
json
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • json
  • Repository

Switch branch/tag
  • json
  • test
  • src
  • unit-user_defined_input.cpp
Find file
BlameHistoryPermalink
  • Jaakko Moisio's avatar
    Fix compilation of input_adapter(container) in edge cases · 467f622c
    Jaakko Moisio authored Dec 28, 2020
    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.
    467f622c
unit-user_defined_input.cpp 3.62 KB
EditWeb IDE
×

Replace unit-user_defined_input.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.