title: Error when trying to shuffle std::vector
body: <p>I have a <a href="https://stackoverflow.com/q/6926433/607407">way to shuffle my <code>std::vector</code></a>. Specifically, I do it using C++98 approach:</p>
  
  <pre><code>void LoopGenerator::shuffle()
  {
      std::random_shuffle(stripes.begin(), stripes.end(), seed);
  }
  </code></pre>
  
  <p>Where <code>LoopGenerator</code> is a class that throws out some data in random order. The vector <code>stripes</code> is defined this way:</p>
  
  <pre><code>std::vector&lt;Generator*&gt; stripes;
  </code></pre>
  
  <p><code>Generator</code> is a <strong>virtual</strong> superclass of <code>LoopGenerator</code>. The vector is supposed to allow all kinds of random generators to be contained and nested, which I use for <a href="https://superuser.com/q/844093/194976">generating stripes</a>. For example, generate 5-50 thin green stripes and then thick brown stripe:</p>
  
  <p><img src="https://i.stack.imgur.com/N3H00.png" alt="random stripes forest theme"></p>
  
  <p>The problem is that my shuffle throws an error:</p>
  
  <pre><code>1&gt;  LoopGenerator.cpp
  1&gt;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\algorithm(2181): error C2064: term does not evaluate to a function taking 1 arguments
  1&gt;          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\algorithm(2206) : see reference to function template instantiation 'void std::_Random_shuffle&lt;random_stripes::Generator**,int,__w64 int&gt;(_RanIt,_RanIt,_Fn1 &amp;,_Diff *)' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              _RanIt=random_stripes::Generator **,
  1&gt;              _Fn1=int,
  1&gt;              _Diff=__w64 int
  1&gt;          ]
  1&gt;          LoopGenerator.cpp(79) : see reference to function template instantiation 'void std::random_shuffle&lt;std::_Vector_iterator&lt;_Myvec&gt;,int&amp;&gt;(_RanIt,_RanIt,_Fn1)' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              _Myvec=std::_Vector_val&lt;std::_Simple_types&lt;random_stripes::Generator *&gt;&gt;,
  1&gt;              _RanIt=std::_Vector_iterator&lt;std::_Vector_val&lt;std::_Simple_types&lt;random_stripes::Generator *&gt;&gt;&gt;,
  1&gt;              _Fn1=int &amp;
  1&gt;          ]
  </code></pre>
  
  <p>This points me to line <code>2181</code> in  <code>&lt;algorighm&gt;</code>. I can see nothing I could understand there.</p>
  
  <p>So what's wrong? Is there a problem with shuffling <em>array of pointers</em>? Or is there something wrong with them being <em>abstract class pointers</em>?</p>
  
  <p>More code:</p>
  
  <h3><code>Generator.h</code> - topmost class that is in <code>std::vector&lt;Generator*&gt; stripes</code></h3>
  
  <pre><code>namespace random_stripes {
  
      class Generator
      {
      public:
          Generator(int);
          Generator();
          virtual ~Generator() {};
          //Returns next stripe and moves internal iterator
          virtual RandomStripe next() = 0;
          //Fills the variables with data AND ITERATES THE POINTER if third argument is true
          virtual void getData(std::string&amp;, int&amp;, bool=true) = 0;
          //Informs parent class/procedure whether all stripes were returned
          virtual bool end() = 0;
          //Reset the pointer (and anything else)
          virtual void reset() = 0;
          //Get/set the random seed
          virtual int setSeed(int);
          virtual int getSeed();
      protected:
          int seed;
      };
  }
  </code></pre>
  
  <h3><code>LoopGenerator.h</code></h3>
  
  <pre><code>namespace random_stripes {
      class LoopGenerator : public ManyStripes
      {
      public:
          LoopGenerator();
          //True if shuffled
          LoopGenerator(bool);
          ~LoopGenerator();
          //If true, every LAP is shuffled (otherwise order is constant)
          bool shuffled;
          //OVERRIDEN METHODS
          virtual RandomStripe next();
          virtual void reset();
          virtual bool end();
          virtual void getData(std::string&amp;, int&amp;, bool=true);
          //Properties
          unsigned int repeat;  //How many times should this sequence repeat
      protected:
          virtual int iterate();
          unsigned int lap;  //How many times DID this sequence repeat aready
  
          void shuffle();    //Shuffle list of elements (defined in ManyStripes)
  
          //Reset without forgeting lap
          void makeLap();
      };
  }
  </code></pre>