mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-07 11:16:11 -04:00
Explicitly =delete; Statement::bindNoCopy(..., std::string&&) (#469)
Rvalues are inherently unsuitable for no-copy binding, because their lifetime cannot be guaranteed. Separately declare, and delete, all overloads of bindNoCopy() that take a std::string rvalue.
This commit is contained in:
commit
c6032d8a7a
@ -178,6 +178,11 @@ public:
|
|||||||
* @warning Uses the SQLITE_STATIC flag, avoiding a copy of the data. The string must remains unchanged while executing the statement.
|
* @warning Uses the SQLITE_STATIC flag, avoiding a copy of the data. The string must remains unchanged while executing the statement.
|
||||||
*/
|
*/
|
||||||
void bindNoCopy(const int aIndex, const void* apValue, const int aSize);
|
void bindNoCopy(const int aIndex, const void* apValue, const int aSize);
|
||||||
|
/**
|
||||||
|
* @brief Deleted, because the value's lifetime could not be guaranteed. Use bind().
|
||||||
|
*/
|
||||||
|
void bindNoCopy(const int aIndex, std::string&& aValue) = delete;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Bind a NULL value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1)
|
* @brief Bind a NULL value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1)
|
||||||
*
|
*
|
||||||
@ -271,6 +276,10 @@ public:
|
|||||||
{
|
{
|
||||||
bindNoCopy(getIndex(apName), apValue, aSize);
|
bindNoCopy(getIndex(apName), apValue, aSize);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @brief Deleted, because the value's lifetime could not be guaranteed. Use bind().
|
||||||
|
*/
|
||||||
|
void bindNoCopy(const char* apName, std::string&& aValue) = delete;
|
||||||
/**
|
/**
|
||||||
* @brief Bind a NULL value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1)
|
* @brief Bind a NULL value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1)
|
||||||
*
|
*
|
||||||
@ -368,6 +377,10 @@ public:
|
|||||||
{
|
{
|
||||||
bindNoCopy(aName.c_str(), apValue, aSize);
|
bindNoCopy(aName.c_str(), apValue, aSize);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @brief Deleted, because the value's lifetime could not be guaranteed. Use bind().
|
||||||
|
*/
|
||||||
|
void bindNoCopy(const std::string& aName, std::string&& aValue) = delete;
|
||||||
/**
|
/**
|
||||||
* @brief Bind a NULL value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1)
|
* @brief Bind a NULL value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1)
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user