xo-umbrella2/xo-alloc2/include/xo/alloc2/AllocRange.hpp
Roland Conybeare 6a82040d48 git subrepo clone git@github.com:Rconybea/xo-alloc2.git xo-alloc2
subrepo:
  subdir:   "xo-alloc2"
  merged:   "4039c29f"
upstream:
  origin:   "git@github.com:Rconybea/xo-alloc2.git"
  branch:   "main"
  commit:   "4039c29f"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 22:01:14 -04:00

34 lines
910 B
C++

/** @file AllocRange.hpp
*
* @author Roland Conybeare, Dec 2025
**/
#pragma once
#include "AllocIterator.hpp"
namespace xo {
namespace mm {
/** @class AllocRange
* @brief Provide range iteration over an @ref AAllcator
*
* Return value type for @ref AAllocator::alloc_range
**/
struct AllocRange {
public:
using repr_type = std::pair<obj<AAllocIterator>, obj<AAllocIterator>>;
public:
AllocRange() = default;
explicit AllocRange(repr_type range) : range_{std::move(range)} {}
obj<AAllocIterator> begin() const { return range_.first; }
obj<AAllocIterator> end() const { return range_.second; }
/** state: {begin,end} pair of alloc iterators **/
repr_type range_;
};
} /*namsepace mm*/
} /*namespace xo*/
/* end AllocRange.hpp */