This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH, c++0x] Use decltype in libstdc++'s parallel/base.h
On Wed, 2008-06-25 at 23:16 -0400, Chris Fairles wrote:
> On Wed, Jun 25, 2008 at 8:32 PM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
> > Hi Chris,
> >
> > you are raising an interesting issue. First blush the code in base.h seems indeed quite hackish and C++ is certainly moving toward good solutions for such kind of problems. My doubts:
> >
> > 1- Can you describe in a bit of detail the problems you are actually encountering? (seeing a long error message without context doesn't really help, ehm ;)
>
> Right. Sorry about that, here's the snippet:
>
> #include <parallel/algorithm>
> #include <parallel/numeric>
>
> template<typename T, std::size_t N>
> void parallel_sort_test(std::array<T,N> & data)
> {
> __gnu_parallel::sort(data.begin(), data.end());
> }
>
> Compiled with something like:
> g++ -ftemplate-depth-128 -O0 -fno-inline -Wall --std=c++0x -pthread -fopenmp
>
> It looks like it doesn't recognize "typeof" as a keyword or builtin or
> whatever it is.
Right, because typeof is a GNU extension and you've disabled GNU
extensions with -std=c++0x. Change that to -std=gnu++0x and typeof will
work.
- Doug