Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't think the code you've shown us exhibits the problem you're asking about.</p> <p>I made minimal changes to get past the earlier compiler errors, so I could get to the point where I could reproduce your problem. But, having done so, your problem does not exist.</p> <p>Here are my changes:</p> <ul> <li>Add <code>#include &lt;list&gt;</code>.</li> <li>Replace each instance of <code>iterator</code> with <code>typename Container::iterator</code></li> <li>Make <code>Container</code> inherit from <code>list</code> publicly instead of privately, so I get access to its <code>iterator</code> type.</li> </ul> <p>You can try adding them one by one to see what errors each one solves—none of them have anything to do with your problem. Or you can <a href="http://pastebin.com/j452zHrp" rel="nofollow">download the code</a> and compile it yourself.</p> <p>I compiled this with a three different compilers, clang-4.2, g++-4.6, and g++-4.2-apple; in both C++11 and C++98 modes where appropriate; with -Wall enabled. In all cases, it compiled without any errors or warnings.</p> <p>Also I don't see how the referenced line could have the error you described. It doesn't matter whether <code>T</code> or <code>C</code> are incomplete, because all you do is:</p> <ul> <li><code>static_cast</code> a <code>T *</code> to a <code>Proxy *</code>, which only requires having <code>T</code> declared, not defined.</li> <li>Access a member of a <code>Proxy</code>, which does not depend in any way on type <code>T</code>.</li> <li>Set a <code>C *</code> to NULL, which only requires having <code>C</code> declared, not defined.</li> </ul> <p>The <em>previous</em> line depends on calling <code>operator *</code> on an <code>iterator</code>, and that's apparently a custom class of your that might be dependent on <code>T</code> or <code>C</code> in some way, but that couldn't possibly cause an error on the next line.</p> <p>So, there are a few possibilities:</p> <ul> <li>The error is not the error your described, nor is it on the line you described, and the problem is in either the <code>iterator</code> class or the <code>list</code> class that you didn't show us.</li> <li>The code you've shown us is so different from your real code that it no longer has even a trace of the part that causes a problem.</li> <li>My trivial changes aren't as trivial as I thought and somehow fixed your problem.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload