You're imbuing a std::locale
, not a bpt::time_facet
.
You can access the current locale of the std::stringstream
from msgStream.getloc()
With the std::locale
object, you can access the facet with it's member facet
:
std::locale myLocale = msgStream.getloc();
myLocale.facet; //Operate on the facet. Returns std::locale::facet.
You can then cast it to your bpt::time_facet
if required.
For more info see class references - imbue, facet, stringstream, locale