Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C++0x regex supported by gcc?

2 views
Skip to first unread message

mattia

unread,
Jan 31, 2010, 12:08:55 PM1/31/10
to
Hi all, do you know if gcc supports the regex library defined in the C+
+0x draft? If so, which version? Can you provide a simple snippet?

Thanks, Mattia

Robert Fendt

unread,
Jan 31, 2010, 12:43:35 PM1/31/10
to

> Hi all, do you know if gcc supports the regex library defined in the C+
> +0x draft? If so, which version? Can you provide a simple snippet?

As far as I know, GCC does not support regular expressions as defined in TR1 as part of its standard library (yet). However, to use 0x features already before standardisation would be a portability nightmare (not to speak of stability issues to be expected in the early implementations).

If you want to stay at least semi-portable and need a solid regex library for C++, just use boost::regex for now. The TR1 specification is based upon it anyway. Or, if you are concerned about code changes after the compilers have caught up with the standard, you can use boost::tr1.

http://www.boost.org/doc/libs/1_41_0/libs/regex/doc/html/index.html
http://www.boost.org/doc/libs/1_41_0/doc/html/boost_tr1.html

Regards,
Robert

Jorgen Grahn

unread,
Feb 2, 2010, 7:58:49 PM2/2/10
to
On Sun, 2010-01-31, mattia wrote:
> Hi all, do you know if gcc supports the regex library defined in the
> C++0x draft? If so, which version?

This ought to be a starting point:
http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html

> Can you provide a simple snippet?

Example code? Why? Using the regex library will look the same, no
matter what compiler you use, as long as it supports it.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Devil Wang

unread,
Feb 4, 2010, 7:49:40 AM2/4/10
to
you should link the BOOST library while compiling .
0 new messages