Re: Polyspace Problem
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Wed, 28 Feb 2007 11:55:29 -0800
"hyderabadblues" <sirishkumar@xxxxxxxxx> writes:
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;
};
Get rid of the leading underscores. Identifiers starting with an
underscore are reserved to the implementation. Some are reserved for
all purposes, others only at file scope; it's easier to avoid leading
underscores altogether than to remember the detailed rules.
A declaration:
struct foo { /* ... */ };
creates a type called "struct foo". You can't refer to it as just
"foo". <OT>C++ does let you refer to it as "foo"; make sure your
compiler is being invoked as a C compiler so it catches these
errors.</OT>
The only things that should appear between the "{" and "}" of a struct
declaration are member declarations. Putting typedefs inside a struct
declaration is illegal and just doesn't make any sense.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- Follow-Ups:
- Re: Polyspace Problem
- From: matevzb
- Re: Polyspace Problem
- From: Al Balmer
- Re: Polyspace Problem
- References:
- Polyspace Problem
- From: hyderabadblues
- Polyspace Problem
- Prev by Date: Re: Comparing string input to enum data type
- Next by Date: Re: significance of graphics in c
- Previous by thread: Re: Polyspace Problem
- Next by thread: Re: Polyspace Problem
- Index(es):
Relevant Pages
|