From 654ea1ec2aa4279cfaee913079fe1215a175eead Mon Sep 17 00:00:00 2001 From: randomdan Date: Tue, 9 Apr 2013 19:14:11 +0000 Subject: Address ambiguity converting to long int on 32bit --- project2/common/variableConvert.cpp | 12 ++++++++---- project2/common/variableType.h | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/project2/common/variableConvert.cpp b/project2/common/variableConvert.cpp index 8fd906f..69082de 100644 --- a/project2/common/variableConvert.cpp +++ b/project2/common/variableConvert.cpp @@ -173,13 +173,17 @@ VariableType::operator const unsigned char *() const { return reinterpret_cast(boost::apply_visitor(ConvertVisitorCharStar(this), *this)); } -VariableType::operator int32_t() const +VariableType::operator int() const { - return boost::apply_visitor(ConvertVisitor(this), *this); + return boost::apply_visitor(ConvertVisitor(this), *this); } -VariableType::operator int64_t() const +VariableType::operator long int() const { - return boost::apply_visitor(ConvertVisitor(this), *this); + return boost::apply_visitor(ConvertVisitor(this), *this); +} +VariableType::operator long long int() const +{ + return boost::apply_visitor(ConvertVisitor(this), *this); } VariableType::operator double() const { diff --git a/project2/common/variableType.h b/project2/common/variableType.h index 21c2c39..d3ac5a0 100644 --- a/project2/common/variableType.h +++ b/project2/common/variableType.h @@ -87,8 +87,9 @@ class VariableType : public _VT { operator const std::string &() const; operator const char *() const; operator const unsigned char *() const; - operator int64_t() const; - operator int32_t() const; + operator long long int() const; + operator long int() const; + operator int() const; operator double() const; operator const boost::posix_time::ptime &() const; template operator boost::optional() const { return isNull() ? boost::optional() : as(); } -- cgit v1.2.3