/** @file DInteger.hpp * * @author Roland Conybeare, Dec 2025 **/ #pragma once #include #include #include #include #include namespace xo { namespace scm { struct DInteger { using AAllocator = xo::mm::AAllocator; using ACollector = xo::mm::ACollector; using ppindentinfo = xo::print::ppindentinfo; using value_type = long; explicit DInteger(long x) : value_{x} {} /** will likely want this to default to ANumeric, once we have it **/ template static obj box(obj mm, long x); /** allocate boxed value @p x using memory from @p mm **/ static DInteger * _box(obj mm, long x); long value() const noexcept { return value_; } bool pretty(const ppindentinfo & ppii) const; operator long() const noexcept { return value_; } // GCObject facet std::size_t shallow_size() const noexcept; DInteger * shallow_copy(obj mm) const noexcept; std::size_t forward_children(obj gc) noexcept; private: /** boxed integer value **/ long value_; }; template obj DInteger::box(obj mm, long x) { return obj(_box(mm, x)); } } /*nmaespace obj*/ } /*namespace xo*/ /* end DInteger.hpp */