#1970 closed Bugs (invalid)
include regex.hpp, no global name for regcomp function of POSIX standard
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | Component: | regex | |
Version: | Boost 1.35.0 | Severity: | Problem |
Keywords: | regex POSIX Compatible C API | Cc: |
Description
I want to use POSIX Compatible C API support for regex library. I include the <boost/regex.hpp> header file to want to get the global name for regcomp function according to the documetation libs\regex\doc\html\boost_regex\ref\posix.html, but failed to pass the compile.
So I decide to include the <boost/cregex.hpp> head file and using the namespace boost, it works. But I don't want to export all the names in the boost namespace to global.
I am using MSVC version 9.0.
Note:
See TracTickets
for help on using tickets.
This is the intended behaviour, there are three headers here:
<boost/regex.hpp> does *not* define the POSIX API's as they're deprecated. <boost/cregex.hpp> does define the POSIX API's but in namespace Boost. <boost/regex.h> does define the POSIX API's and imports them into the global namespace.
In other words, if you want compatibility with other POSIX implementations, then regex.h is the right one to include, and NOT regex.hpp.
HTH, John Maddock