build: fix build with newer boost and c++11

(pull requesting this for @theuni in his absence)
Fixes #5166, build with boost >=1.55 and c++11

We don't actively support building the source with c++11, but this is the only problem preventing it from working, so may just as well fix it.