xo-alloc xo-object: + Object.self_tp
This commit is contained in:
parent
ea60d107e8
commit
150bfa4aa2
11 changed files with 76 additions and 14 deletions
|
|
@ -4,9 +4,13 @@
|
|||
*/
|
||||
|
||||
#include "Integer.hpp"
|
||||
#include "xo/reflect/Reflect.hpp"
|
||||
#include <cstddef>
|
||||
|
||||
namespace xo {
|
||||
using xo::reflect::Reflect;
|
||||
using xo::reflect::TaggedPtr;
|
||||
|
||||
namespace obj {
|
||||
Integer::Integer(int_type x) : value_{x} {}
|
||||
|
||||
|
|
@ -20,6 +24,11 @@ namespace xo {
|
|||
return dynamic_cast<Integer*>(x.ptr());
|
||||
}
|
||||
|
||||
TaggedPtr
|
||||
Integer::self_tp() const {
|
||||
return Reflect::make_tp(const_cast<Integer*>(this));
|
||||
}
|
||||
|
||||
std::size_t
|
||||
Integer::_shallow_size() const {
|
||||
return sizeof(Integer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue