多空间问题 [英] Polyspace Problem

查看:49
本文介绍了多空间问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述






我正在使用polyspace工具。

当我编译以下代码时,我收到错误as

__true_type undefined

struct __true_type {

};


struct __type_traits {


typedef __true_type _h;

};


任何人都可以帮我这个

解决方案

2月28日上午9:44,hyderabadblues < sirishku ... @ gmail.comwrote:





我正在使用polyspace工具。



我认为这是无关紧要的,并且使你的主题成为你的一部分会使人们回应的可能性降低。你的问题只是一个语言问题。


当我编译以下代码时,我收到的错误是

__true_type undefined



这是因为你还没有定义一个叫做__ true_type的类型。


>

struct __true_type {


};



这里你定义了一个名为__ true_type的结构类型。 (顺便说一句,我/ b $ b)有一种感觉,使用__作为标识符的开头是标准的b $ b。我认为该名称空间是为

实现者)。


>

struct __type_traits {


typedef __true_type _h;



这里你试图定义_h (同样,一个领先的_并不是建议使用
,我似乎记得)是一种引用数据类型的方式

" __ true_type"你还没有定义。


>

};


任何人都可以帮助我这个



我不能完全确定你在这里想要达到的目标,所以它不是很好的b / b



我怀疑你需要重新阅读你的参考书,以了解

typedef的用途以及它的用途。

我认为您尝试做的一种方法是: -


typedef struct __true_type true_type_t;

struct __true_type {


};


struct __type_traits {


true_type_t _h;


};


2月28日上午10:58,mark_blue ... @ pobox.com写道:


2月28日上午9:44,hyderabadblues < sirishku ... @ gmail.comwrote:




I我正在使用polyspace工具。



我认为这是无关紧要的,并且使你的主题成为一部分会使人们不太可能做出回应。你的问题只是一个语言问题。


当我编译以下代码时,我收到的错误是

__true_type undefined



这是因为你还没有定义一个名为__ true_type的类型。


struct __true_type {


};



这里你定义了一个名为__ true_type的结构类型。 (顺便说一句,我/ b $ b)有一种感觉,使用__作为标识符的开头是标准的b $ b。我认为该名称空间是为

实现者)。


struct __type_traits {


typedef __true_type _h;



这里你试图定义_h (同样,一个领先的_并不是建议使用
,我似乎记得)是一种引用数据类型的方式

" __ true_type"你还没有定义。


};


任何人都可以帮我这个



我不完全确定是什么你正试图在这里实现,所以它不是很简单。


我怀疑你需要重读你的参考书来理解什么

typedef和它的用途。


我认为你想做的一种方法是: -


typedef struct __true_type true_type_t;

struct __true_type {


};


struct __type_traits {


true_type_t _h;


};



实际上代码是由我们设计的STL的摘录。我已经修改它以使其变得容易。

但是相同的代码在VC ++编译器中没有任何错误


hyderabadblues写道:


实际上代码是由我们设计的STL的摘录。我已经修改它以使其变得简单。

但是相同的代码没有在VC ++编译器中给出任何错误



如果你问一个C ++问题,我们可以给你的最好帮助是

"在C ++新闻组中询问。


-

Chris" electric hedgehog" Dollin

花了很长时间,比最慷慨的估计要长得多。

- James White,/ Sector General /



Hi,

I am using polyspace tool.
When I compile the following code I am getting the error as
__true_type undefined
struct __true_type{
};

struct __type_traits{

typedef __true_type _h;
};

Can anybody help me regarding this

解决方案

On Feb 28, 9:44 am, "hyderabadblues" <sirishku...@gmail.comwrote:

Hi,

I am using polyspace tool.

That''s irrelevant, I think, and making that part of your subject makes
it less likely that people will respond. Your problem is simply a C
language issue.

When I compile the following code I am getting the error as
__true_type undefined

This is because you haven''t defined a type called "__true_type".

>
struct __true_type{

};

Here you''ve defined a structure type called "__true_type". (BTW, I
have a feeling that using "__" as the start of an identifier is
against the standard. That namespace is, I think, reserved for
implementors).

>
struct __type_traits{

typedef __true_type _h;

Here you''re trying to define that "_h" (again a leading "_" is not
recommended, I seem to recall) is a way of referring to the data type
"__true_type" which you haven''t defined.

>
};

Can anybody help me regarding this

I''m not totally sure what you are trying to achieve here, so it''s not
easy.

I suspect you need to reread your reference books to understand what
typedef does and what it''s for.

One approach to what I think you are trying to do would be :-

typedef struct __true_type true_type_t;
struct __true_type{

};

struct __type_traits{

true_type_t _h;

};


On Feb 28, 10:58 am, mark_blue...@pobox.com wrote:

On Feb 28, 9:44 am, "hyderabadblues" <sirishku...@gmail.comwrote:

Hi,

I am using polyspace tool.


That''s irrelevant, I think, and making that part of your subject makes
it less likely that people will respond. Your problem is simply a C
language issue.

When I compile the following code I am getting the error as
__true_type undefined


This is because you haven''t defined a type called "__true_type".

struct __true_type{

};


Here you''ve defined a structure type called "__true_type". (BTW, I
have a feeling that using "__" as the start of an identifier is
against the standard. That namespace is, I think, reserved for
implementors).

struct __type_traits{

typedef __true_type _h;


Here you''re trying to define that "_h" (again a leading "_" is not
recommended, I seem to recall) is a way of referring to the data type
"__true_type" which you haven''t defined.

};

Can anybody help me regarding this


I''m not totally sure what you are trying to achieve here, so it''s not
easy.

I suspect you need to reread your reference books to understand what
typedef does and what it''s for.

One approach to what I think you are trying to do would be :-

typedef struct __true_type true_type_t;
struct __true_type{

};

struct __type_traits{

true_type_t _h;

};


Actually the code is a extract of STL that is designed by us.I have
modified it to make it easy.
But the same code does not give any error in VC++ compiler


hyderabadblues wrote:

Actually the code is a extract of STL that is designed by us.I have
modified it to make it easy.
But the same code does not give any error in VC++ compiler

If you''re asking a C++ question, the best help we can give you is
"ask in the C++ newsgroup".

--
Chris "electric hedgehog" Dollin
"It took a very long time, much longer than the most generous estimates."
- James White, /Sector General/


这篇关于多空间问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆