Changed operator << for Value to explicitly call the conversion operators.
The static_cast route caused it to compile streaming into a vector but actually generated code that would fail at runtime. This new version won't compile when the left hand is a vector.
This commit is contained in:
parent
1727b0d645
commit
a76686acfd
1 changed files with 5 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
#include "Pgsql_oids.h"
|
#include "Pgsql_oids.h"
|
||||||
#include "ArrayParser.h"
|
#include "ArrayParser.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <vector>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
|
|
@ -132,6 +133,8 @@ namespace Pgsql {
|
||||||
start = ++pos; // skip space and set new start to match
|
start = ++pos; // skip space and set new start to match
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Oid getOid() const { return m_typ; }
|
||||||
private:
|
private:
|
||||||
const char *m_val;
|
const char *m_val;
|
||||||
Oid m_typ;
|
Oid m_typ;
|
||||||
|
|
@ -140,7 +143,8 @@ namespace Pgsql {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void operator<<(T &s, const Value &v)
|
void operator<<(T &s, const Value &v)
|
||||||
{
|
{
|
||||||
s = static_cast<T>(v);
|
//s = static_cast<T>(v);
|
||||||
|
s = v.operator T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue