/** @file DFloat.hpp * * @author Roland Conybeare, Dec 2025 **/ #pragma once #include #include #include #include namespace xo { namespace scm { struct DFloat { using AAllocator = xo::mm::AAllocator; using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using VisitReason = xo::mm::VisitReason; using ppindentinfo = xo::print::ppindentinfo; using value_type = double; explicit DFloat(double x) : value_{x} {} /** probably want default = ANumeric, once we introduce it **/ template static obj box(obj mm, double x); /** allocate boxed value @p x using memory from @p mm **/ static DFloat * _box(obj mm, double x); double value() const noexcept { return value_; } operator double() const noexcept { return value_; } bool pretty(const ppindentinfo & ppii) const; // GCObject facet DFloat * gco_shallow_move(obj gc) noexcept; void visit_gco_children(VisitReason reason, obj gc) noexcept; private: /** boxed floating-oint value **/ double value_; }; template obj DFloat::box(obj mm, double x) { return obj(DFloat::_box(mm, x)); } } /*nmaespace scm*/ } /*namespace xo*/ /* end DFloat.hpp */