fixes for macos/clang

This commit is contained in:
Günter Obiltschnig
2020-01-09 11:53:03 +01:00
parent 1bf40a0cd2
commit 03d1dd9822
41 changed files with 389 additions and 1317 deletions

View File

@@ -40,22 +40,22 @@ class Struct;
class Foundation_API Var
/// Var allows to store data of different types and to convert between these types transparently.
/// Var puts forth the best effort to provide intuitive and reasonable conversion semantics and prevent
/// Var puts forth the best effort to provide intuitive and reasonable conversion semantics and prevent
/// unexpected data loss, particularly when performing narrowing or signedness conversions of numeric data types.
///
/// An attempt to convert or extract from a non-initialized ("empty") Var variable shall result
/// in an exception being thrown.
///
/// Loss of signedness is not allowed for numeric values. This means that if an attempt is made to convert
/// the internal value which is a negative signed integer to an unsigned integer type storage, a RangeException is thrown.
/// Overflow is not allowed, so if the internal value is a larger number than the target numeric type size can accommodate,
/// Loss of signedness is not allowed for numeric values. This means that if an attempt is made to convert
/// the internal value which is a negative signed integer to an unsigned integer type storage, a RangeException is thrown.
/// Overflow is not allowed, so if the internal value is a larger number than the target numeric type size can accommodate,
/// a RangeException is thrown.
///
/// Precision loss, such as in conversion from floating-point types to integers or from double to float on platforms
/// where they differ in size (provided internal actual value fits in float min/max range), is allowed.
///
/// String truncation is allowed -- it is possible to convert between string and character when string length is
/// greater than 1. An empty string gets converted to the char '\0', a non-empty string is truncated to the first character.
///
/// String truncation is allowed -- it is possible to convert between string and character when string length is
/// greater than 1. An empty string gets converted to the char '\0', a non-empty string is truncated to the first character.
///
/// Boolean conversion is performed as follows:
///
@@ -66,18 +66,18 @@ class Foundation_API Var
///
/// Arithmetic operations with POD types as well as between Var's are supported, subject to following
/// limitations:
///
///
/// - for std::string and const char* values, only '+' and '+=' operations are supported
///
///
/// - for integral and floating point numeric values, following operations are supported:
/// '+', '+=', '-', '-=', '*', '*=' , '/' and '/='
/// '+', '+=', '-', '-=', '*', '*=' , '/' and '/='
///
/// - for integral values, following operations are supported:
/// prefix and postfix increment (++) and decrement (--)
///
///
/// - for all other types, InvalidArgumentException is thrown upon attempt of an arithmetic operation
///
/// A Var can be created from and converted to a value of any type for which a specialization of
///
/// A Var can be created from and converted to a value of any type for which a specialization of
/// VarHolderImpl is available. For supported types, see VarHolder documentation.
{
public:
@@ -88,7 +88,7 @@ public:
Var();
/// Creates an empty Var.
template <typename T>
template <typename T>
Var(const T& val)
/// Creates the Var from the given value.
#ifdef POCO_NO_SOO
@@ -125,7 +125,7 @@ public:
Iterator end();
/// Returns the Var iterator.
template <typename T>
template <typename T>
void convert(T& val) const
/// Invoke this method to perform a safe conversion.
///
@@ -147,8 +147,8 @@ public:
pHolder->convert(val);
}
template <typename T>
template <typename T>
T convert() const
/// Invoke this method to perform a safe conversion.
///
@@ -173,12 +173,12 @@ public:
pHolder->convert(result);
return result;
}
template <typename T>
operator T () const
/// Safe conversion operator for implicit type
/// conversions. If the requested type T is same as the
/// type being held, the operation performed is direct
/// conversions. If the requested type T is same as the
/// type being held, the operation performed is direct
/// extraction, otherwise it is the conversion of the value
/// from type currently held to the one requested.
///
@@ -227,7 +227,7 @@ public:
std::string(typeid(T).name())));
}
template <typename T>
template <typename T>
Var& operator = (const T& other)
/// Assignment operator for assigning POD to Var
{
@@ -271,7 +271,7 @@ public:
const Var operator -- (int);
/// Post-decrement operator
template <typename T>
template <typename T>
Var& operator += (const T& other)
/// Addition assignment operator for addition/assignment of POD to Var.
{
@@ -284,7 +284,7 @@ public:
Var& operator += (const char* other);
/// Addition assignment operator overload for const char*
template <typename T>
template <typename T>
const Var operator - (const T& other) const
/// Subtraction operator for subtracting POD from Var
{
@@ -294,7 +294,7 @@ public:
const Var operator - (const Var& other) const;
/// Subtraction operator overload for Var
template <typename T>
template <typename T>
Var& operator -= (const T& other)
/// Subtraction assignment operator
{
@@ -304,7 +304,7 @@ public:
Var& operator -= (const Var& other);
/// Subtraction assignment operator overload for Var
template <typename T>
template <typename T>
const Var operator * (const T& other) const
/// Multiplication operator for multiplying Var with POD
{
@@ -314,7 +314,7 @@ public:
const Var operator * (const Var& other) const;
/// Multiplication operator overload for Var
template <typename T>
template <typename T>
Var& operator *= (const T& other)
/// Multiplication assignment operator
{
@@ -324,7 +324,7 @@ public:
Var& operator *= (const Var& other);
/// Multiplication assignment operator overload for Var
template <typename T>
template <typename T>
const Var operator / (const T& other) const
/// Division operator for dividing Var with POD
{
@@ -334,7 +334,7 @@ public:
const Var operator / (const Var& other) const;
/// Division operator overload for Var
template <typename T>
template <typename T>
Var& operator /= (const T& other)
/// Division assignment operator
{
@@ -344,7 +344,7 @@ public:
Var& operator /= (const Var& other);
/// Division assignment operator specialization for Var
template <typename T>
template <typename T>
bool operator == (const T& other) const
/// Equality operator
{
@@ -358,7 +358,7 @@ public:
bool operator == (const Var& other) const;
/// Equality operator overload for Var
template <typename T>
template <typename T>
bool operator != (const T& other) const
/// Inequality operator
{
@@ -372,7 +372,7 @@ public:
bool operator != (const char* other) const;
/// Inequality operator overload for const char*
template <typename T>
template <typename T>
bool operator < (const T& other) const
/// Less than operator
{
@@ -383,7 +383,7 @@ public:
bool operator < (const Var& other) const;
/// Less than operator overload for Var
template <typename T>
template <typename T>
bool operator <= (const T& other) const
/// Less than or equal operator
{
@@ -394,7 +394,7 @@ public:
bool operator <= (const Var& other) const;
/// Less than or equal operator overload for Var
template <typename T>
template <typename T>
bool operator > (const T& other) const
/// Greater than operator
{
@@ -405,7 +405,7 @@ public:
bool operator > (const Var& other) const;
/// Greater than operator overload for Var
template <typename T>
template <typename T>
bool operator >= (const T& other) const
/// Greater than or equal operator
{
@@ -552,7 +552,7 @@ public:
static std::string toString(const Var& var);
/// Converts the Var to a string in JSON format. Note that toString(const Var&) will return
/// a different result than Var::convert<std::string>() and Var::toString()!
private:
Var& getAt(std::size_t n);
Var& getAt(const std::string& n);
@@ -577,7 +577,7 @@ private:
{
return convert<T>() - other.convert<T>();
}
template <typename T>
T multiply(const Var& other) const
{
@@ -2123,9 +2123,6 @@ inline bool operator != (const char* other, const Var& da)
}
#ifndef POCO_LONG_IS_64_BIT
inline long operator + (const long& other, const Var& da)
/// Addition operator for adding Var to long
{
@@ -2334,9 +2331,6 @@ inline bool operator >= (const unsigned long& other, const Var& da)
}
#endif // POCO_LONG_IS_64_BIT
} // namespace Dynamic