Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1970 closed Bugs (invalid)

include regex.hpp, no global name for regcomp function of POSIX standard

Reported by: arthurlee <boyal@…> 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.

Change History (3)

comment:1 by John Maddock, 14 years ago

Resolution: invalid
Status: newclosed

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

comment:2 by arthurlee <boyal@…>, 14 years ago

Thanks a lot. I understood it.

comment:3 by (none), 14 years ago

Milestone: Boost 1.35.1

Milestone Boost 1.35.1 deleted

Note: See TracTickets for help on using tickets.