Skip to content

Commit

Permalink
Disallow constructing rowset from a session
Browse files Browse the repository at this point in the history
This doesn't make sense, so explicitly delete the ctor from session to
prevent such code from compiling.

Closes #1081.

See #1082.
  • Loading branch information
cstiborg authored and vadz committed Oct 11, 2023
1 parent 1b14b7c commit 2e4b44b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/soci/rowset.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ class rowset
pimpl_->incRef();
}

// Due to the existence of conversion from session to prepare_temp_type, it
// would have been possible to construct a rowset from session if we didn't
// delete this ctor -- so do delete it because it doesn't make sense to
// provide such constructor.
rowset(session const& session) = delete;

~rowset()
{
pimpl_->decRef();
Expand Down

0 comments on commit 2e4b44b

Please sign in to comment.