[PATCH, c++0x] Use decltype in libstdc++'s parallel/base.h
Chris Fairles
chris.fairles@gmail.com
Wed Jun 25 23:37:00 GMT 2008
I got weird errors using the parallel libstdc++ algo's in c++0x mode.
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/algobase.h:46,
from
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/algorithm:42,
from benchmark.cpp:5:
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:290:
error: expected identifier before â*â token
/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:290:
error: expected â,â or â...â before âstatic_castâ
/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:291:
error: expected â;â before âresultâ
/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:294:
error: expected â;â before âoperatorâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:296:
error: expected â;â before â}â token
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:302:
error: expected identifier before â*â token
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:302:
error: expected â,â or â...â before âstatic_castâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:303:
error: expected â;â before âresultâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:306:
error: expected â;â before âoperatorâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:308:
error: expected â;â before â}â token
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:315:
error: expected identifier before â*â token
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:315:
error: expected â,â or â...â before âstatic_castâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:316:
error: expected â;â before âresultâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:319:
error: expected â;â before âoperatorâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:321:
error: expected â;â before â}â token
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:327:
error: expected identifier before â*â token
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:327:
error: expected â,â or â...â before âstatic_castâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:328:
error: expected â;â before âresultâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:331:
error: expected â;â before âoperatorâ
lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../include/c++/4.4.0/parallel/base.h:333:
error: expected â;â before â}â token
Attached is a patch that uses decltype instead of typeof in c++0x mode.
Not sure if this is the right solution. If so, I can write up some
test cases etc..
Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parallel_algo_cpp0x.patch
Type: application/octet-stream
Size: 1950 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080625/ecb2d51d/attachment.obj>
More information about the Libstdc++
mailing list