标题:typedef 和 inline 问题
取消只看楼主
bclee
Rank: 1
等 级:新手上路
帖 子:23
专家分:0
注 册:2007-9-16
 问题点数:0 回复次数:1 
typedef 和 inline 问题
class   screen
{   public   :
        typedef   std::string::size_type   index;
        index   get_cursor()   const;
};
      inline   screen::index   screen::get_cursor()   const
{   return   cursor;
}

为什么会多出红色部分,   在外部的函数定义上指定inline   ,应该也是   inline   +   类名::函数名吧?
搜索更多相关主题的帖子: typedef inline 
2008-01-25 09:09
bclee
Rank: 1
等 级:新手上路
帖 子:23
专家分:0
注 册:2007-9-16
得分:0 
就是说screen::index用法相当于 int 等数据类型 ,只是它规定了这种类型的可见性

inline   (screen::index )  screen::get_cursor()   const     所以应该这样理解吧
         数据 类型       类名    函数

谢谢高人指点!!!
2008-01-25 10:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-198658-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013830 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved