• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: struct completion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: struct completion


  • Subject: Re: struct completion
  • From: Markian Hlynka <email@hidden>
  • Date: Thu, 3 Jun 2004 13:21:50 -0600

On Jun 3, 2004, at 12:42, Greg Pfeil wrote:

On 2 Jun 2004, at 13:28, Markian Hlynka wrote:

I've tried:
    struct footype
    {
       int bar;
    }foo;

    foo thevar;
    thevar.

This definitely _shouldn't_ work ... what you're doing here is saying "make me a struct named 'footype', then while you're at it, declare a variable 'foo' of that type." So, when you later try to use 'foo' as a type, it just won't happen.



yes, I agree. I copied what someone else wrote; I think they forgot the typedef.


and also

    typedef struct footype
    {
       int bar;
    }foo;

    foo thevar;
    thevar.b

Hrmm, not quite sure why this isn't showing completions. This should be saying "make me a struct named 'footype', and also a type 'foo' that refers to that struct." This is how I get completion on my structs. Maybe there's something subtly different here that I'm not seeing.



again, I agree. However, it started working for some of my structs, but not all of them! I haven't fiddled with it much, recently, too busy actually coding. :)



Just for completeness, you mentioned earlier:

	struct foo
	{
		int bar;
	}

	foo thevar;

which I would not expect to work, either. The declaration of 'thevar' would have to look like this, I would think:

	struct foo thevar;

the typedef in the previous examples is used to eliminate the need for 'struct' in all the variable declarations.


No, I disagree with you here. Or, at least, I disagree with you in C++. In C, you are correct. in C++, a struct is automatically named. (Or am I wrong?)


Perhaps this is why completion is wonky? I'm using .cc file extensions for my C++ code... Maybe the completion in xcode thinks it's C, even though the compiler knows it's C++?

Markian
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: struct completion (From: Ben <email@hidden>)
 >Re: struct completion (From: Markian Hlynka <email@hidden>)
 >Re: struct completion (From: Greg Pfeil <email@hidden>)

  • Prev by Date: Re: struct completion
  • Next by Date: Strip headers from imbedded frameworks
  • Previous by thread: Re: struct completion
  • Next by thread: inter-target build dependencies?
  • Index(es):
    • Date
    • Thread