Re: VC++ standard compliance - code
From: BigMan (fn42551_at_fmi.uni-sofia.bg)
Date: 07/11/04
- Previous message: Sergei: "Re: VC++ standard compliance - code"
- In reply to: Sergei: "Re: VC++ standard compliance - code"
- Next in thread: Sergei: "Re: VC++ standard compliance - code"
- Reply: Sergei: "Re: VC++ standard compliance - code"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 11 Jul 2004 17:05:07 +0300
Thanks for the note on main! In fact, I could not find clause 999.9.9.9.9 of
ISO/IEC 14882:1998(E). Did you mean 3.6.1.2?
Now suppose I have 2 versions of a func in the base class: a const one and a
non-const one. They are both private. Are both versions made public in the
derived class if I add a using declaration in the public section of the
derived class? If so, how do I make only one of them public?
"Sergei" <sergei@nospam.summertime.mtu-net.ru> wrote in message
news:eRBCaQyZEHA.2840@TK2MSFTNGP11.phx.gbl...
> Though the void f() declaration in D hides the f name in B, the
> using declaration brings it back to D. So both f functions are
> visible and both calls are properly resolved.
> Note that exception specification is not considered part of
> a functions type and it's the difference in the type of the implicit
> object parameter that makes the declarations overloadable.
> Declaring the main function parameters in any way other
> then (int argc, char *argv[]) invokes undefined behavior
> as per clause 999.9.9.9.9 of ISO/IEC 14882:1998(E)
>
> Sergei
>
> "BigMan" <fn42551@fmi.uni-sofia.bg> wrote in message
news:ua6Gw9wZEHA.384@TK2MSFTNGP10.phx.gbl...
> > Here's the code and by the way VC++ 7.1 does compile it:
> >
> >
////////////////////////////////////////////////////////////////////////////
> > ///
> >
> > class B
> >
> > {
> >
> > public:
> >
> > void f( ) const throw( )
> >
> > {
> >
> > }
> >
> > };
> >
> >
////////////////////////////////////////////////////////////////////////////
> > ///
> >
> > class D : public B
> >
> > {
> >
> > public:
> >
> >
> > using B::f;
> >
> >
> > void f( )
> >
> > {
> >
> > }
> >
> > };
> >
> >
////////////////////////////////////////////////////////////////////////////
> > ///
> >
> > int main
> >
> > (
> >
> > int NumberOfArguments,
> >
> > char** Arguments
> >
> >
> > )
> >
> > {
> >
> > D a;
> >
> > a.f( );
> >
> >
> > D const b;
> >
> > b.f( );
> >
> >
> > return 0;
> >
> > }
> >
> >
////////////////////////////////////////////////////////////////////////////
> > ///
- Previous message: Sergei: "Re: VC++ standard compliance - code"
- In reply to: Sergei: "Re: VC++ standard compliance - code"
- Next in thread: Sergei: "Re: VC++ standard compliance - code"
- Reply: Sergei: "Re: VC++ standard compliance - code"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|