[odb-users] lazy_ptr and operator->

Boris Kolpackov boris at codesynthesis.com
Fri Jun 5 12:52:51 EDT 2015


Hi Andrew,

Andrew Cunningham <andrew at a-cunningham.com> writes:

> I was wondering why ODB does not do an automatic load() when the
> operator-> of a lazy pointer is called?
> The explicit use of load() seems quite a burden.

The reason is this: you have to call load() within a transaction.
Making operator->() implicitly call it would be very error prone.

Boris



More information about the odb-users mailing list