| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1730 人关注过本帖
标题:用vecto做三维向量产生warning,不知哪里的问题
只看楼主 加入收藏
naughtyboy
Rank: 1
等 级:新手上路
帖 子:23
专家分:0
注 册:2006-8-5
收藏
得分:0 
8楼: 那个 iterator allocator 自己定义吗? 不会吧?

wangxiang: 你是不连续两次点了 build 或者 compile?
那样的话,warning 就会被忽略掉。

这个时候 在文件里面随便哪个地方加个空格(也就是要让文件被标记为 修改) 再编译或build , warning 就会重新出现。
2006-10-09 21:54
haha520
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-10-9
收藏
得分:0 
可以自己写的。
2006-10-09 21:58
haha520
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-10-9
收藏
得分:0 
allocator
template<class T>
class allocator {
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T *pointer;
typedef const T *const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef T value_type;
pointer address(reference x) const;
const_pointer address(const_reference x) const;
allocator();
allocator<T>& operator=(const allocator<T>);
pointer allocate(size_type n, const void *hint);
void deallocate(pointer p, size_type n);
void construct(pointer p, const T& val);
void destroy(pointer p);
size_type max_size() const;
};
2006-10-09 22:01
haha520
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-10-9
收藏
得分:0 
你就改一下。

template<class T>
class al
{
typedef typename allcator<T>::size_type size_type;
typedef typename allcator<T>::difference_type difference_type;
typedef T *pointer;
typedef const T *const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef T value_type;
pointer address(reference x) const;
const_pointer address(const_reference x) const;
a();
a<T>& operator=(const a<T>);
pointer allocate(size_type n, const void *hint);
void deallocate(pointer p, size_type n);
void construct(pointer p, const T& val);
void destroy(pointer p);
size_type max_size() const;
};

应该这样可以用吧。
2006-10-09 22:06
快速回复:用vecto做三维向量产生warning,不知哪里的问题
数据加载中...
 
   



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

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