Skip to content
Snippets Groups Projects

bug fix for rlib::printable_iter, to allow object that only has nonconst begin() to get printable_iter

Merged Recolic requested to merge stdio-allow-nonconst-begin into master

Example: std::range

#include <ranges>
#include <rlib/stdio.hpp>
#include <concepts>

// 1. std::invocable
auto filter(auto func, const auto &seq) {
    return seq | std::views::filter(func);
}

int main() {
    std::vector v{1,2,3,4,5,6,7,8,9};
    auto res = filter([](auto i){return i%2==0;}, v);
    rlib::println(rlib::printable_iter(res));
    // 2. std::range doesn't has const begin()
}
Edited by Recolic

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading