Jean-Marc Lasgouttes wrote:

> Hmm, could one of you ask on the boost list? I am not subscribed to
> it (lame excuse, I know).
> 
> Ronald, could you tell us again what kind of error this cures?
> 
> I agree that boost/regex/config.hpp would be a nice place for such
> code.

Reading the source it seems to be used so:

#define BOOST_REGEX_CHAR_T char
#ifdef BOOST_REGEX_NARROW_INSTANTIATE
#  define BOOST_REGEX_INSTANTIATE
#endif
#include <boost/regex/v3/instances.hpp>
#undef BOOST_REGEX_CHAR_T
#ifdef BOOST_REGEX_INSTANTIATE
#  undef BOOST_REGEX_INSTANTIATE
#endif

#ifndef BOOST_NO_WREGEX
#define BOOST_REGEX_CHAR_T wchar_t
#ifdef BOOST_REGEX_WIDE_INSTANTIATE
#  define BOOST_REGEX_INSTANTIATE
#endif
#include <boost/regex/v3/instances.hpp>
#undef BOOST_REGEX_CHAR_T
#ifdef BOOST_REGEX_INSTANTIATE
#  undef BOOST_REGEX_INSTANTIATE
#endif
#endif

Ie, use 'narrow' or 'wide' chars in the regex library but not both.

The thing is:
$ grep -r BOOST_REGEX_NARROW_INSTANTIATE .
./boost/boost/regex/v3/regex.hpp:#ifdef BOOST_REGEX_NARROW_INSTANTIATE
./boost/libs/regex/src/instances.cpp:#define 
BOOST_REGEX_NARROW_INSTANTIATE
$

Why does nobody else need to set it explicitly?


-- 
Angus

Reply via email to