0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Fixed operators += et al

This commit is contained in:
rbock 2014-08-22 12:26:48 +02:00
parent 15c778844b
commit fd054d8a5a
4 changed files with 7 additions and 9 deletions

View File

@ -205,7 +205,7 @@ namespace sqlpp
using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
return { *static_cast<const Base*>(this), {{*static_cast<const Base*>(this), rhs{t}}}};
}
template<typename T>
@ -214,7 +214,7 @@ namespace sqlpp
using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
return { *static_cast<const Base*>(this), {{*static_cast<const Base*>(this), rhs{t}}}};
}
template<typename T>
@ -223,7 +223,7 @@ namespace sqlpp
using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
return { *static_cast<const Base*>(this), {{*static_cast<const Base*>(this), rhs{t}}}};
}
template<typename T>
@ -232,7 +232,7 @@ namespace sqlpp
using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
return { *static_cast<const Base*>(this), {{*static_cast<const Base*>(this), rhs{t}}}};
}
};
};

View File

@ -150,7 +150,7 @@ namespace sqlpp
using rhs = wrap_operand_t<T>;
static_assert(_is_valid_operand<rhs>::value, "invalid rhs assignment operand");
return { *static_cast<const Base*>(this), { *static_cast<const Base*>(this), rhs{t} } };
return { *static_cast<const Base*>(this), concat_t<Base, wrap_operand_t<T>>{ *static_cast<const Base*>(this), rhs{t} } };
}
};
};

View File

@ -165,8 +165,6 @@ struct MockDbT: public sqlpp::connection
template<typename PreparedInsert>
size_t run_prepared_insert(const PreparedInsert& x)
{
_serializer_context_t context;
::sqlpp::serialize(x, context);
return 0;
}
@ -181,8 +179,6 @@ struct MockDbT: public sqlpp::connection
template<typename PreparedSelect>
result_t run_prepared_select(PreparedSelect& x)
{
_serializer_context_t context;
::sqlpp::serialize(x, context);
return {};
}

View File

@ -68,6 +68,8 @@ int main()
db(update(t).set(t.delta = sqlpp::null).where(true));
db(update(t).set(t.delta = sqlpp::default_value).where(true));
db(update(t).set(t.delta += t.alpha * 2, t.beta += " and cake").where(true));
return 0;
}