Due to a bug in g++ < 7.1, these specializations must be explicitly
enclosed in the namespaces rather than using the usual
`namespace::namespace::function` notation.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480.
We already use this work-around in a number of places.