title: Why does this code trying to hold an array of function pointer return an error?
body: <p>I have already looked at <a href="https://stackoverflow.com/questions/15128444/c-calling-a-function-from-a-vector-of-function-pointers-inside-a-class-where-t">this</a> question. This is the error message I receive:<br />
  <code>E0304 no instance of overloaded function &quot;std::vector&lt;_Ty, _Alloc&gt;::push_back [with _Ty=void (*)(), _Alloc=std::allocator&lt;void (*)()&gt;]&quot; matches the argument list</code></p>
  <p>My goal is to get all pointers to function in a vector so I can loop through them for various datasets by testing the different sorting algorithms
  My code:</p>
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;fstream&gt;
      #include &lt;chrono&gt;
      using namespace std;
      #ifndef Sort_h
      #define Sort_h
  
      class Sort : public Algorithm
      {
      public:
          Sort() {
              algorithms.push_back((sortalgorithms::bubble));
              //algorithms.push_back(&amp;(sortalgorithms::merge));
              //algorithms.push_back(&amp;(sortalgorithms::insertion));
          }
          ~Sort();
          void load(string);
          void execute();
          void display();
          void stats();
          void select(int);
          void save();
          void configure();
      
      private:
          int type = 0;
          vector&lt;int&gt; data;
          string sortname;
          int vecSize = 0;
          string fileName;
          chrono::duration&lt;double&gt; time;
          std::vector&lt;void (*)()&gt; algorithms;
      };
      
      #endif
  </code></pre>
  <pre><code>    #pragma once
      #include &quot;Algorithm.h&quot;
      #include &lt;string&gt;
      #ifndef algorithm_h
      #define algorithm_h
      using namespace std;
      class Algorithm {
      public:
          Algorithm() {};
          virtual ~Algorithm() {};
          virtual void load(string) = 0;
          virtual void execute() = 0;
          virtual void display() = 0;
          virtual void stats() = 0;
          virtual void select() = 0;
          virtual void save() = 0;
          virtual void configure() = 0;
      };
      
      #endif algorithm_h
  </code></pre>
  <p>I want to call a function from a vector of function pointers.</p>