There seem to be no const overloads for getting the underlying Device of boost::iostream::stream. It might not be as trivial as by adding the following two lines, because sub-sequential calls do not seem to implement the const overloads either.
I'm not sure if there is some reason why there are no const overloads for these particular methods. As far as I can see there shouldn't be any issue to add them. Currently I can work around this problem by marking the stream in the example as mutable.
There seem to be no
const
overloads for getting the underlyingDevice
ofboost::iostream::stream
. It might not be as trivial as by adding the following two lines, because sub-sequential calls do not seem to implement theconst
overloads either.I'm not sure if there is some reason why there are no
const
overloads for these particular methods. As far as I can see there shouldn't be any issue to add them. Currently I can work around this problem by marking the stream in the example asmutable
.In any case here an example: https://coliru.stacked-crooked.com/a/fe70537e096a2b0b. Or use the code below: