mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-14 23:07:56 +02:00
- VS2012: build/tests
- JSON: style and exceptions catch by ref fix - NumberParser: case-insensitive hex parsing - Dynamic::Var: const std::string& cast operator specialization (coaxing std::string ctor) - LocalDateTime: strftime fix (buffer too small for full tz string, use %Z instead of %z - makes no difference on windows but is more portable) - small buildwin.cmd vsvars32.bat call fix
This commit is contained in:
@@ -156,6 +156,8 @@ public:
|
||||
if (!_pHolder)
|
||||
throw InvalidAccessException("Can not convert empty value.");
|
||||
|
||||
if (typeid(T) == _pHolder->type()) return extract<T>();
|
||||
|
||||
T result;
|
||||
_pHolder->convert(result);
|
||||
return result;
|
||||
@@ -188,6 +190,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
operator const std::string & ();
|
||||
/// Specialization of the cast operator for const std::string reference.
|
||||
/// The main reason for this specialization is to help compilers
|
||||
/// with construction/assignment of Var to std::string.
|
||||
|
||||
template <typename T>
|
||||
const T& extract() const
|
||||
/// Returns a const reference to the actual value.
|
||||
@@ -210,8 +217,6 @@ public:
|
||||
typeid(T).name()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename T>
|
||||
Var& operator = (const T& other)
|
||||
/// Assignment operator for assigning POD to Var
|
||||
@@ -558,6 +563,7 @@ private:
|
||||
///
|
||||
/// Var members
|
||||
///
|
||||
|
||||
inline void Var::swap(Var& ptr)
|
||||
{
|
||||
std::swap(_pHolder, ptr._pHolder);
|
||||
|
Reference in New Issue
Block a user