You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trompeloeil's mocks should be movable, when the bool member trompeloeil_movable_mock is set to true. But currently it is limited to move-construction; move-assignment is not supported. Is there a reason for this? Or is it just a bug?
A simple fix would be just the line: expectations& operator =(expectations&&) = default; in the struct expectations definition.
Btw, as a side-note: it's never a good idea to explicitly specify noexcept on defaulted functions, as this is can and will be overriden by compilers. => expectations(expectations&&) noexcept = default;
The text was updated successfully, but these errors were encountered:
Is this a question from a philosophical point of view, or do you have a real world use case?
The latter seems to be a mistake (unless it was added as a work-around for some old compiler, I don't remember). I'll remove it (possibly conditionally depending on compiler).
Well, I often stumble across this. I sometimes simply want to setup expectations on a mock and then move it somewhere and do not care, whether it's moved somewhere else or not.
The most annoying fact is, that mock types can not be used as template types, where std::movable (or any depending concept) is required.
Trompeloeil's mocks should be movable, when the bool member
trompeloeil_movable_mock
is set totrue
. But currently it is limited to move-construction; move-assignment is not supported. Is there a reason for this? Or is it just a bug?A simple fix would be just the line:
expectations& operator =(expectations&&) = default;
in thestruct expectations
definition.Btw, as a side-note: it's never a good idea to explicitly specify
noexcept
on defaulted functions, as this is can and will be overriden by compilers. =>expectations(expectations&&) noexcept = default;
The text was updated successfully, but these errors were encountered: