[odb-users] Moving odb::result<T>

Sean Clarke sean.clarke at sec-consulting.co.uk
Sun Sep 13 15:23:38 EDT 2015


Hi,
    I have been doing some tidying etc. and moved some queries into a
factory class, however I am getting segsv issues when I try and move the
results of some queries...

Program received signal SIGSEGV, Segmentation fault.
0x00000000004eca92 in odb::result<Job>::size (this=0x7fffffffd6f0)
    at orm_test/libodb-2.4.0/odb/result.hxx:209
209      return impl_ ? impl_->size () : 0;

I just perform a simple query and return the resultant odb::result using a
std::move....

If I don't call the std::move and just return the result it does not give a
segv, but doesn't work  - but I sort of expected this from the info you
assisted me with previously regarding multiple iterations over the
container/forward_iterator<>.

I can "fudge" it by copying data to a std::vector<T>, but would rather not
if at all possible.


Regards
Sean Clarke


More information about the odb-users mailing list