xo-umbrella2/xo-object2/src/object2/DInteger.cpp
Roland Conybeare dff1b8e6ad git subrepo clone git@github.com:Rconybea/xo-object2.git xo-object2
subrepo:
  subdir:   "xo-object2"
  merged:   "8156e514"
upstream:
  origin:   "git@github.com:Rconybea/xo-object2.git"
  branch:   "main"
  commit:   "8156e514"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 22:16:08 -04:00

48 lines
1.1 KiB
C++

/** @file DInteger.cpp
*
* @author Roland Conybeare, Jan 2026
**/
#include "DInteger.hpp"
#include <xo/indentlog/print/pretty.hpp>
#include <xo/indentlog/scope.hpp>
namespace xo {
using xo::facet::typeseq;
using xo::print::ppdetail_atomic;
namespace scm {
DInteger *
DInteger::_box(obj<AAllocator> mm, long x)
{
void * mem = mm.alloc(typeseq::id<DInteger>(),
sizeof(DInteger));
if (mem)
return new (mem) DInteger(x);
return nullptr;
}
bool
DInteger::pretty(const ppindentinfo & ppii) const
{
return ppdetail_atomic<long>::print_pretty(ppii, value_);
}
DInteger *
DInteger::gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept
{
return gc.std_move_for(this);
}
void
DInteger::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
{
// no-op. childless
}
} /*namespace scm*/
} /*namespace xo*/
/* end DInteger.cpp */