|
Boost : |
From: John Maddock (jm_at_[hidden])
Date: 2002-09-01 05:41:28
> A simple question: I'm rewriting the stream inserter and the stream
> extractor for dynamic_bitset. Having a need for widening the
> characters '0' and '1' I have used BOOST_USE_FACET:
>
>
> Ch const zero = BOOST_USE_FACET(std::ctype<Ch>, loc).widen('0');
> Ch const one = BOOST_USE_FACET(std::ctype<Ch>, loc).widen('1');
>
>
> Anyhow the code fails to compile on VC++ 6.0 with STLport 4.5.3
> because BOOST_USE_FACET is not defined at all. Of course it should.
> BTW in this situation one can just use the standard syntax.
>
> The problem seems to be that BOOST_NO_STD_LOCALE gets defined
> somewhere (note that I use SGI IOStreams), thus config/suffix.hpp
> defines BOOST_NO_STD_USE_FACET but finds none of
> BOOST_HAS_TWO_ARG_USE_FACET,
> BOOST_HAS_MACRO_USE_FACET,
> BOOST_HAS_STLP_USE_FACET
>
> defined to select the appropriate definition for BOOST_USE_FACET.
>
>
> Why BOOST_NO_STD_LOCALE gets defined?
It's a namespace handling bug, the code that gets triggered in this case is
(at least I think I've got this right):
#if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) &&
defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
# define BOOST_NO_STD_LOCALE
#endif
the problem is that things like:
const std::ctype<char>* pct;
don't compile !!
John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk