• 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: Strange bug: struct is not a type in C++?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange bug: struct is not a type in C++?


  • Subject: Re: Strange bug: struct is not a type in C++?
  • From: Nicholaz Beresford <email@hidden>
  • Date: Wed, 08 Oct 2008 20:32:51 +0200


Well, it did compile ok on a MSVC8 before I sent my answer to the list (did not have an GCC available at that time) and the MS compile error in the original code was not so different from yours.



Nick


Jean-Denis Muys wrote:

On 8 oct. 08, at 10:38, Nicholaz Beresford wrote:

    class1::insideStruct *p1;
    class1::insideStruct *p2;


Unsurprisingly, this doesn't work as you cannot use a template class without specifying the actual type parameter.

Indeed, the compiler complains on this with :

/.../main.cpp:24: error: 'template<class Type> class class1' used without template parameters
/.../main.cpp:24: error: ISO C++ forbids declaration of 'insideStruct' with no type
/.../main.cpp:24: error: expected ';' before '*' token


(also, in my original code, the comments were reversed: the line without "struct" is rejected, while the line with "struct" compiles fine).

Jean-Denis

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Strange bug: struct is not a type in C++?
      • From: Nick Zitzmann <email@hidden>
References: 
 >Strange bug: struct is not a type in C++? (From: Jean-Denis Muys <email@hidden>)
 >Re: Strange bug: struct is not a type in C++? (From: Nicholaz Beresford <email@hidden>)
 >Re: Strange bug: struct is not a type in C++? (From: Jean-Denis Muys <email@hidden>)

  • Prev by Date: NSMatrix of text fields
  • Next by Date: Re: NSMatrix of text fields
  • Previous by thread: Re: Strange bug: struct is not a type in C++?
  • Next by thread: Re: Strange bug: struct is not a type in C++?
  • Index(es):
    • Date
    • Thread