title: Error in C++ list::sort
body: <p>Getting a bunch of errors and they are very cryptic.</p>
  
  <p>Here's all the relevant code:</p>
  
  <pre><code>// list::sort
  #include &lt;iostream&gt;
  #include &lt;list&gt;
  #include &lt;string&gt;
  #include &lt;cctype&gt;
  #include "main.h"
  
  using namespace std;
  
  struct texture
  {
      int texture;
      int ref;
  };
  
  bool compare_nocase (texture first, texture second)
  {
      if(first.texture &lt; second.texture)
      {
          return true;
      }
      else
      {
          return false;
      }
  }
  
  int main ()
  {
    list&lt;texture&gt; mylist;
    list&lt;texture&gt;::iterator it;
  
    texture moose;
    moose.ref = 3;
    moose.texture = 6;
  
    texture moose2;
    moose2.ref = 1;
    moose2.texture = 3;
  
    texture moose3;
    moose3.ref = 2;
    moose3.texture = 14;
  
    mylist.push_back (moose);
    mylist.push_back (moose2);
    mylist.push_back (moose3);
  
    cout &lt;&lt; "before sort mylist contains:";
    for (it=mylist.begin(); it!=mylist.end(); ++it)
        cout &lt;&lt; it-&gt;texture &lt;&lt; endl;
    cout &lt;&lt; endl;
  
  
    mylist.sort(compare_nocase);
  
    cout &lt;&lt; "after sort mylist contains:";
    for (it=mylist.begin(); it!=mylist.end(); ++it)
      cout &lt;&lt; it-&gt;texture &lt;&lt; endl;
    cout &lt;&lt; endl;
  
    return 0;
  }
  </code></pre>
  
  <p>I am just testing out the STL sort function but I get the errors:</p>
  
  <pre><code>c:\users\spaniel\documents\visual studio 2010\projects\list\list\main.cpp(12): error C2380: type(s) preceding 'texture' (constructor with return type, or illegal redefinition of current class-name?)
  1&gt;c:\users\spaniel\documents\visual studio 2010\projects\list\list\main.cpp(18): error C2274: 'function-style cast' : illegal as right side of '.' operator
  1&gt;c:\users\spaniel\documents\visual studio 2010\projects\list\list\main.cpp(18): error C2274: 'function-style cast' : illegal as right side of '.' operator
  1&gt;c:\users\spaniel\documents\visual studio 2010\projects\list\list\main.cpp(35): error C2274: 'function-style cast' : illegal as right side of '.' operator
  1&gt;c:\users\spaniel\documents\visual studio 2010\projects\list\list\main.cpp(39): error C2274: 'function-style cast' : illegal as right side of '.' operator
  1&gt;c:\users\spaniel\documents\visual studio 2010\projects\list\list\main.cpp(43): error C2274: 'function-style cast' : illegal as right side of '.' operator
  1&gt;c:\users\spaniel\documents\visual studio 2010\projects\list\list\main.cpp(51): error C2273: 'function-style cast' : illegal as right side of '-&gt;' operator
  1&gt;c:\users\spaniel\documents\visual studio 2010\projects\list\list\main.cpp(59): error C2273: 'function-style cast' : illegal as right side of '-&gt;' operator
  </code></pre>