Thread: template and friend class

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by black_spot1984 View Post
    Nobody can help me?

    Ah... crap.
    If you're gonna give up after 15 minutes I guess our lives are a bit easier...
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  2. #2
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    The only piece of code that seems to maybe have that error is:
    Code:
    friend class LinkedList<;  //!< LinkedList can access private members of LLNode
    I believe you need something like this:
    Code:
    template <typename T>
    class LLNode {
     friend class LinkedList<T>;
     ...
    };
    Or something like this so LLNode knows that LinkedList is a template class

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. Template Class as a friend of another class
    By Bnchs in forum C++ Programming
    Replies: 2
    Last Post: 12-02-2007, 05:25 PM
  3. Replies: 8
    Last Post: 07-24-2006, 08:14 AM
  4. Declare a template class as a friend?
    By AH_Tze in forum C++ Programming
    Replies: 11
    Last Post: 05-19-2004, 09:24 PM
  5. oh me oh my hash maps up the wazoo
    By DarkDays in forum C++ Programming
    Replies: 5
    Last Post: 11-30-2001, 12:54 PM