xo-reader: integer arithmetic + parser + pretty-printing adds
This commit is contained in:
parent
0f89542e11
commit
dc26b97802
2 changed files with 31 additions and 6 deletions
|
|
@ -240,13 +240,13 @@ namespace xo {
|
|||
TypeDescrExtra * tdextra() const { return tdextra_.get(); }
|
||||
Metatype metatype() const { return tdextra_->metatype(); }
|
||||
|
||||
/* true iff the type represented by *this is the same as the type
|
||||
* represented by T.
|
||||
/** true iff the type represented by _c *this is the same as the type
|
||||
* represented by @tparam T
|
||||
*
|
||||
* Warning: comparing typeinfo address can give false negatives.
|
||||
* suspect this is caused by problems coalescing linker symbols
|
||||
* in the clang toolchain.
|
||||
*/
|
||||
**/
|
||||
template<typename T>
|
||||
[[deprecated]]
|
||||
bool is_native() const {
|
||||
|
|
@ -317,6 +317,10 @@ namespace xo {
|
|||
}
|
||||
} /*recover_native2*/
|
||||
|
||||
bool is_i128() const;
|
||||
bool is_i64() const;
|
||||
bool is_f64() const;
|
||||
|
||||
bool is_pointer() const { return this->tdextra_->is_pointer(); }
|
||||
bool is_vector() const { return this->tdextra_->is_vector(); }
|
||||
bool is_struct() const { return this->tdextra_->is_struct(); }
|
||||
|
|
|
|||
|
|
@ -254,6 +254,22 @@ namespace xo {
|
|||
{
|
||||
}
|
||||
|
||||
bool
|
||||
TypeDescrBase::is_i64() const
|
||||
{
|
||||
static_assert(sizeof(long long) == 8);
|
||||
|
||||
return Reflect::is_native<long long>(this);
|
||||
}
|
||||
|
||||
bool
|
||||
TypeDescrBase::is_f64() const
|
||||
{
|
||||
static_assert(sizeof(double) == 8);
|
||||
|
||||
return Reflect::is_native<double>(this);
|
||||
}
|
||||
|
||||
TaggedPtr
|
||||
TypeDescrBase::most_derived_self_tp(void * object) const
|
||||
{
|
||||
|
|
@ -311,6 +327,11 @@ namespace xo {
|
|||
#endif
|
||||
|
||||
TypeDescrTable::TypeDescrTable() {
|
||||
/* want long == i64 */
|
||||
static_assert(sizeof(long) == 8);
|
||||
/* want double == f64 */
|
||||
static_assert(sizeof(double) == 8);
|
||||
|
||||
Reflect::require<bool>();
|
||||
Reflect::require<char>();
|
||||
Reflect::require<short>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue