Replace all implicit container move and clear by an explicit function


We are likely relying on the fact that most implementations of containers
clear the moved from container when calling std::move. That being said
this behavior is likely implementation/platform dependent and could
bite us at some later point.

This patch introduces a moveAndClear function that does the move and an
explicit clear and use it in all appropriate places.

Change-Id: I8081d09907e17e287741fa952269af22df4dcf5f
Reviewed-by: Mike Krus <mike.krus@kdab.com>
commitc4194c5a37b2879fd5802f00d45c46f31278b0b3
parente7c53539ae743d49df7eab800e4b17f449f4f0e8
authorPaul Lemire <paul.lemire@kdab.com>
committerPaul Lemire <paul.lemire@kdab.com>
commit timeWed, 24 Feb 2021 15:45:26 +0100