Re: Polyspace Problem
- From: "matevzb" <matevzb@xxxxxxxxx>
- Date: 28 Feb 2007 13:19:00 -0800
On Feb 28, 8:55 pm, Keith Thompson <k...@xxxxxxx> wrote:
"hyderabadblues" <sirishku...@xxxxxxxxx> writes:<OT>Actually, OP's compiler must be a C++ compiler, since typedef-
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>
within-a-struct seems to be legal in C++. An example from working
draft ISO:
struct X {
typedef int T;
static T count;
void f(T);
};
void X::f(T t = count ) { }
</OT>
--
WYCIWYG - what you C is what you get
.
- Follow-Ups:
- Re: Polyspace Problem
- From: Keith Thompson
- Re: Polyspace Problem
- References:
- Polyspace Problem
- From: hyderabadblues
- Re: Polyspace Problem
- From: Keith Thompson
- Polyspace Problem
- Prev by Date: Re: Polyspace Problem
- Next by Date: Re: Polyspace Problem
- Previous by thread: Re: Polyspace Problem
- Next by thread: Re: Polyspace Problem
- Index(es):
Relevant Pages
|