[LAD] [OT] Has anyone managed to compile this?

Dominic Sacré dominic.sacre at gmx.de
Sat Jan 16 01:25:16 UTC 2010


On Sat, Jan 16, 2010 at 1:08 AM, Victor Lazzarini
<Victor.Lazzarini at nuim.ie> wrote:
> Torben's  new project  brought  back to my mind this mind-bending C++
> template example (see attached), which I could not yet get to compile, I
> have been told it has been compiled, but g++ will have none of it. So I
> still have doubts on whether it includes legal C++ code or not. But it is an
> interesting example (even if it does not build) of what (possibly) can be
> done with templates.
>
> My question to the list is: has anyone managed to compile this code?

Wow, that's insane. But as far as I can tell, it is (almost) valid
C++. What gcc rightly complains about are a couple of missing typename
keywords. That's actually a pretty common mistake, because it's hard
to understand why these are even necessary, and some compilers simply
don't care.
The attached version of the file compiles fine with gcc, and the
program gives the correct answer.


Dominic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prime.cpp
Type: text/x-c++src
Size: 4390 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20100116/038099f3/attachment.cpp>


More information about the Linux-audio-dev mailing list