This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, c++0x] Use decltype in libstdc++'s parallel/base.h
On Wed, Jun 25, 2008 at 8:32 PM, Paolo Carlini <firstname.lastname@example.org> 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:
template<typename T, std::size_t N>
void parallel_sort_test(std::array<T,N> & data)
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. So the expression in base.h is something like
typeof(*static_cast<T*>(NULL) * *static_cast<T*>(NULL)) result;
The first couple of errors are:
expected identifier before '*' token
expected ',' or '...' before 'static_cast'
__typeof__ I think would work. This common_type is interesting
however. Is it going in?
> 2- Johannes opinion?
> 3- Do we believe decltype is sufficiently stable for our uses at least? (comp. e.g., c++/36628)
> 4- Shall we just implement (__)common_type (n2615 -> n2661)?