xo-objectd2 xo-printable xo-facet: pp working for List(Integer)
Also streamline facet switching
This commit is contained in:
parent
d5e1e6290b
commit
148d5e9ca0
13 changed files with 379 additions and 8 deletions
|
|
@ -5,11 +5,32 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
#include <xo/indentlog/print/ppindentinfo.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
using DInteger = std::int64_t;
|
||||
struct DInteger {
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
||||
explicit DInteger(long x) : value_{x} {}
|
||||
|
||||
/** allocate boxed value @p x using memory from @p mm **/
|
||||
static DInteger * make(obj<AAllocator> mm,
|
||||
long x);
|
||||
|
||||
double value() const noexcept { return value_; }
|
||||
|
||||
bool pretty(const ppindentinfo & ppii) const;
|
||||
|
||||
operator long() const noexcept { return value_; }
|
||||
|
||||
private:
|
||||
/** boxed integer value **/
|
||||
long value_;
|
||||
};
|
||||
} /*nmaespace obj*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue