build: fix newer boost build with c++11

(pull requesting this for @theuni in his absence)
Fixes #5166