|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-07-25 12:36:28
Did you report this at http://gcc.gnu.org/cgi-bin/gnatsweb.pl
-Dave
----- Original Message -----
From: <helmut.zeisel_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, July 25, 2001 1:11 PM
Subject: [boost] operators.hpp / GCC 3.0 / empty base class optimization
> There seems to be a bug w.r.t. the
> empty base class optimization in GCC 3.0
> which makes operators.hpp more or less unuseable:
>
> "c++ mytest.cpp; a.out" compiled with GCC 3.0 / Linux crashes.
> "c++ -DNONEMPTY mytest.cpp; a.out" works.
>
> Helmut
>
> class empty_base
> {
> #ifdef NONEMPTY
> int i;
> #endif
> };
>
> template <class T, class B = empty_base>
> struct multipliable1 : B
> {
> friend T operator*(T x, const T& y) { return x *= y; }
> };
>
> class A : multipliable1<A >
> {
> public:
> A(int n) {m_v.push_back(0);}
>
> A& operator*=(const A& other) {return *this;}
> private:
> std::vector<int> m_v;
> };
>
>
> int main()
>
> A a(1);
> A(1)*A(1);
> a=1;
> return 0;
> }
>
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk