[FZH] c++中的override和覆盖的区别

Ying Chen justin.nankai at gmail.com
Wed Jun 6 14:57:43 UTC 2012


лл£¡

2012/6/6 Robin Lee <robinlee.sysu在gmail.com>

> ÔÚ C++ Àº¯ÊýÃûÏàͬµ«ÊäÈë²ÎÊý²»Ïàͬ¾ÍÊDz»Í¬µÄº¯Êý
>
> 2012/6/6 Ying Chen <justin.nankai在gmail.com>
>
> > лл£¡Ô­À´overrideÊÇ·­ÒëΪ¸²¸Ç£¬ÎÒ°Ñ¡®¸²¸Ç¡¯ºÍ¡®Òþ²Ø¡¯»ìÏýÁË¡£ÄÇÈç¹û¸¸ÀຯÊýÉùÃ÷ÁËvirtual£¬µ«×ÓÀຯÊýµÄinput
> > argumetns²»Ò»Ñù£¬ÕâʱºòÊÇoverride¸¸ÀຯÊý»¹ÊÇÒþ²Ø¸¸ÀຯÊý£¿
> >
> > 2012/6/6 Robin Lee <robinlee.sysu在gmail.com>
> >
> > > Ö»Òª×ÓÀàʵÏÖÁËÏàͬ signature µÄº¯Êý£¬¾ÍÊǸ²¸Ç(override)Á˸¸ÀàµÄº¯Êý¡£Ö»ÊÇÈç¹û¸¸ÀàµÄ¶ÔÓ¦µÄº¯ÊýûÓÐÉùÃ÷Ϊ virtual
> > > ¾ÍÎÞ·¨ÊµÏÖ¶à̬ (polymorphism)
> > >
> > > 2012/6/6 Ying Chen <justin.nankai在gmail.com>
> > >
> > > > Ïò´ó¼ÒÇë½Ì¸ö¹ØÓÚc++µÄÎÊÌ᣺
> > > >
> > > > 1.  c++ÖеÄoverrideÊDz»ÊDZØÐëÒªÓÃvirtual À´ÊµÏÖ£¿
> > > > 2.  ʲôÇé¿öÏÂ×ÓÀàµÄº¯Êýoverride¸¸ÀàµÄº¯Êý£¬Ê²Ã´Çé¿öϸ²¸Ç¸¸ÀàµÄº¯Êý£¿
> > > >
> > > > ÔÚÍøÉÏËÑÁËһȦ£¬Ëµ¸÷Öִ𰸵Ķ¼ÓУ¬²éÁËc++ primerÒ²²»ÖªËùÒÔ£¬Ï£ÍûÄÄλ¸ßÊÖ¿ÉÒÔ°ïæ½â´ðһϣ¬Íò·Ö¸Ðл¡«¡«
> > > > --
> > > > FedoraÖÐÎÄà]¼þÁÐ±í£º
> https://admin.fedoraproject.org/mailman/listinfo/chinese
> > > >
> > > --
> > > FedoraÖÐÎÄà]¼þÁÐ±í£ºhttps://admin.fedoraproject.org/mailman/listinfo/chinese
> > >
> >
> > --
> > FedoraÖÐÎÄà]¼þÁÐ±í£ºhttps://admin.fedoraproject.org/mailman/listinfo/chinese
> >
> >
> --
> FedoraÖÐÎÄà]¼þÁÐ±í£ºhttps://admin.fedoraproject.org/mailman/listinfo/chinese
>


More information about the Chinese mailing list