tags:

views:

149

answers:

1

I want to play with constexpr, does any compiler support it yet?

+7  A: 

The Apache Stdcxx project has a nice table detailing which C++0x features are supported by which compilers. It's been updated on a regular basis and covers most of the modern C++ compilers.

According to that, only GCC 4.5 supports constexpr (note that that support may be experimental).

Between that list and what has been said in the comments, it appears the answer is "no."

James McNellis
The [official GCC support table](http://gcc.gnu.org/projects/cxx0x.html) states that `constexpr` is not supported at all. My code does compile with `constexpr`, but it seems to have no effect whatsoever. My first guess is that the keyword is simply ignored?
FredOverflow
@Fred: Maybe no one supports it then. I don't use gcc frequently enough to know much about its C++0x support, sadly.
James McNellis
Just tested on g++ (GCC) 4.6.0 20100605 -- still can't create an array of size returned by a constexpr function. Reading bugzilla, it appears GCC 4.5 introduced syntax, but not (yet) semantics.
Cubbi