Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2008-01-26 23:46:16


On 01/25/08 23:07, Larry Evans wrote:
> The attached code attempts to use CRTP (Curiously Recurring Template
> Pattern) to see if recursive_variant can be avoided; however,
> I'm getting 2 variant's produced instead of 1 and the which gives
> the wrong result.

The attached code has test_list(void) and test_variant(void).
The former has variant as super, the latter just uses a variant.
The former gets wrong results, the latter correct results.

There must be a compiler bug, AFAICT. I'm using g++4.1 on
linux created with uguntu-7.10-desktop-amd64.iso.

g++-4.1 -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

Anyone else having similar problems?




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk