Boost logo

Boost :

Subject: Re: [boost] why the output is different?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-04-09 11:55:56


AMDG

Dongfei Yin wrote:
> I write some code like this:
>
> #include <iostream>
>
> using namespace std;
>
> class Base1
> {
> public:
> typedef Base1 base;
> };
>
> class Base2
> {
> typedef Base2 base;
> public:
> };
>
> class A
> : public Base1
> , public Base2
> {
> public:
> A()
> {
> base::f();
> }
> };
>
> the output depends on the sequence of base class, that means the
> "typedef" in base class is unreliable.
> complier gives no warning.
> I try these code at both VS2005 and VS2008, the result are same.

I don't think this should actually compile, since base is ambiguous.
(gcc doesn't compile it)

In Christ,
Steven Watanabe


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