Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A move constructor for the session object #526

Open
biot023 opened this issue Mar 5, 2017 · 5 comments
Open

A move constructor for the session object #526

biot023 opened this issue Mar 5, 2017 · 5 comments

Comments

@biot023
Copy link

biot023 commented Mar 5, 2017

Hi -- it would be nice to have a move constructor for the session object.
I'm writing a wrapper around a connection pool for a project I'm working on, and having to return session instances in unique_ptrs.
Which is fine, I guess, but it would be nice to use value semantics.

@biot023
Copy link
Author

biot023 commented Mar 5, 2017

Oh, just in case that sounded like a whinge -- love SOCI so far! :)

@vadz
Copy link
Member

vadz commented Mar 5, 2017

Adding a move ctor to this class shouldn't be a problem, if you can add the few required lines and a test to check that it's working, please feel free to submit a pull request with them. Just please use #ifdef SOCI_HAVE_CXX_C11 around the new code as SOCI still supports compiling in C++98 mode.

@biot023
Copy link
Author

biot023 commented Mar 5, 2017

I'll have a look in the week -- cheers, @vadz

@mloskot
Copy link
Contributor

mloskot commented Mar 5, 2017

Good idea, thanks in advance @biot023

@biot023
Copy link
Author

biot023 commented Mar 6, 2017

I've had a quick look on my lunch hour -- you'll need to bear with me -- the code changes are probably easy enough, but I've got to figure out the test framework and work out how to test my changes! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants