"is private within this context" is being thrown for function which should not be private (GCC 5.3.0, C++11)
<p>I am attempting to create a queue, which requires the creation of another object stored in the queue. The errors are</p>

<pre><code>binary.cpp: In function ‘int main()’:
binary.cpp:183:1: error: ‘Queue&lt;T&gt;::Queue(T) [with T = binary&lt;std::basic_string&lt;char&gt; &gt;*]’ is private
 Queue&lt;T&gt;::Queue(T item){
 ^
binary.cpp:286:65: error: within this context
  Queue&lt;binary&lt;string&gt;*&gt;* queue = new Queue&lt;binary&lt;string&gt;*&gt;(tree);
                                                                 ^
</code></pre>

<p>and </p>

<pre><code>binary.cpp: In instantiation of ‘Queue&lt;T&gt;::Queue(T) [with T = binary&lt;std::basic_string&lt;char&gt; &gt;*]’:
binary.cpp:286:65:   required from here
binary.cpp:132:1: error: ‘Link&lt;T&gt;::Link(T) [with T = binary&lt;std::basic_string&lt;char&gt; &gt;*]’ is private
 Link&lt;T&gt;::Link(T item){
 ^
binary.cpp:184:7: error: within this context
  head = new Link&lt;T&gt;(item);
</code></pre>

<p>The first is the instantiation of the Queue, and the second comes from the Queue's constructor, which is called in the instantiation line in the first error. The important declarations and definitions are:</p>

<pre><code>template&lt;class T&gt;
class Link{
    Link(T item);

    private:
    T content;
    Link&lt;T&gt;* next;
};

template&lt;class T&gt;
Link&lt;T&gt;::Link(T item){
    content = item;
    next = NULL;
}

template&lt;class T&gt;
class Queue{
    Queue();
    Queue(T item);

    private:
    Link&lt;T&gt;* head;
    Link&lt;T&gt;* end;
    int length;
};

template&lt;class T&gt;
Queue&lt;T&gt;::Queue(T item){
    head = new Link&lt;T&gt;(item);
    end = head;
    length = 1;
}
</code></pre>

<p>The Link class is declared and defined before the Queue class, and both are declared and defined before they are used in code. Thank you for your time.</p>