Merge pull request #1298 from Repiteo/int-to-variant-fix
Add missing int→Variant conversionspull/1310/head
commit
c4b7b08c91
|
@ -154,10 +154,18 @@ public:
|
|||
Variant(int64_t v);
|
||||
Variant(int32_t v) :
|
||||
Variant(static_cast<int64_t>(v)) {}
|
||||
Variant(uint32_t v) :
|
||||
Variant(int16_t v) :
|
||||
Variant(static_cast<int64_t>(v)) {}
|
||||
Variant(int8_t v) :
|
||||
Variant(static_cast<int64_t>(v)) {}
|
||||
Variant(uint64_t v) :
|
||||
Variant(static_cast<int64_t>(v)) {}
|
||||
Variant(uint32_t v) :
|
||||
Variant(static_cast<int64_t>(v)) {}
|
||||
Variant(uint16_t v) :
|
||||
Variant(static_cast<int64_t>(v)) {}
|
||||
Variant(uint8_t v) :
|
||||
Variant(static_cast<int64_t>(v)) {}
|
||||
Variant(double v);
|
||||
Variant(float v) :
|
||||
Variant((double)v) {}
|
||||
|
@ -209,8 +217,12 @@ public:
|
|||
operator bool() const;
|
||||
operator int64_t() const;
|
||||
operator int32_t() const;
|
||||
operator int16_t() const;
|
||||
operator int8_t() const;
|
||||
operator uint64_t() const;
|
||||
operator uint32_t() const;
|
||||
operator uint16_t() const;
|
||||
operator uint8_t() const;
|
||||
operator double() const;
|
||||
operator float() const;
|
||||
operator String() const;
|
||||
|
|
|
@ -268,6 +268,14 @@ Variant::operator int32_t() const {
|
|||
return static_cast<int32_t>(operator int64_t());
|
||||
}
|
||||
|
||||
Variant::operator int16_t() const {
|
||||
return static_cast<int16_t>(operator int64_t());
|
||||
}
|
||||
|
||||
Variant::operator int8_t() const {
|
||||
return static_cast<int8_t>(operator int64_t());
|
||||
}
|
||||
|
||||
Variant::operator uint64_t() const {
|
||||
return static_cast<uint64_t>(operator int64_t());
|
||||
}
|
||||
|
@ -276,6 +284,14 @@ Variant::operator uint32_t() const {
|
|||
return static_cast<uint32_t>(operator int64_t());
|
||||
}
|
||||
|
||||
Variant::operator uint16_t() const {
|
||||
return static_cast<uint16_t>(operator int64_t());
|
||||
}
|
||||
|
||||
Variant::operator uint8_t() const {
|
||||
return static_cast<uint8_t>(operator int64_t());
|
||||
}
|
||||
|
||||
Variant::operator double() const {
|
||||
double result;
|
||||
to_type_constructor[FLOAT](&result, _native_ptr());
|
||||
|
|
Loading…
Reference in New Issue