title: Cannot call non-static function on a class object in a vector
body: <p>I'm bulding my own Neural Network with my own Matrix class.</p>
  <p>I'm trying to use the <code>swishMatrix()</code> function on a <code>Matrix2D</code> class object, before adding it to a <code>vector&lt;Matrix2D&gt;</code> variable.
  But I get this error and I have no idea why. -&gt; <code>no matching function for call to 'std::vector&lt;Matrix2D&gt;::push_back(int)'|</code></p>
  <p>When I use the <code>swishMatrix()</code> on a normal <code>Matrix2D</code> object it works fine.</p>
  <p>Here's the <code>Matrix2D</code> class</p>
  <pre><code>class Matrix2D{
      public:
          int rows;
          int columns;
          vector&lt;vector&lt;float&gt; &gt; matrix;
          Matrix2D() = default;
          Matrix2D(int x, int y){
              rows = x;
              columns = y;
              for (int i = 0; i &lt; rows; i++) {
                  vector&lt;float&gt; v1;
                  for (int j = 0; j &lt; columns; j++) {
                      v1.push_back(0);
                  }
                  matrix.push_back(v1);
              }
          }
          swishMatrix(){            
              for (int i = 0; i &lt; rows; i++) {
                  for (int j = 0; j &lt; columns; j++) {
                      matrix[i][j] = matrix[i][j] * sigmoid(matrix[i][j]);
                  }
              }            
          }        
          //Here there's a lot of static functions for matrix operations
  };
  </code></pre>
  <p>Here's the <code>Neural Network</code> class</p>
  <pre><code>class NeuralNewtork{
      public:
         
          //A lot more declaration here but not important
          Matrix2D first_hidden_weights;
  
          Matrix2D input_nodes;
  
          vector&lt;Matrix2D&gt; hidden_weights;      
  
          vector&lt;Matrix2D&gt; hidden_biases; 
  
          vector&lt;Matrix2D&gt; activated_hidden_nodes;       
  
          NeuralNewtork(int input_nodes, int hidden_layers, int hidden_nodes, int action_nodes){
              first_hidden_weights = Matrix2D(numberof_hidden_nodes, numberof_input_nodes);
              first_hidden_weights.randomizeMatrix();            
  
              hidden_weights.reserve(numberof_hidden_layers-1);
              for (int i=0; i&lt;numberof_hidden_layers-1; i++){
                  hidden_weights.push_back(Matrix2D(numberof_hidden_nodes, numberof_hidden_nodes));
                  hidden_weights.back().randomizeMatrix();
              }           
  
              hidden_biases.reserve(numberof_hidden_layers);
              for (int i=0; i&lt;numberof_hidden_layers; i++){
                  hidden_biases.push_back(Matrix2D(numberof_hidden_nodes, 1));
                  hidden_biases.back().randomizeMatrix();
              }     
              //There are more declerations here but they aren't important for this problem   
          }
  
          feedForward(Matrix2D input){
              input_nodes = input;
  
          
              for(int i = 0; i &lt; numberof_hidden_layers+1; i++){
                  if(i==0){                    
                      activated_hidden_nodes.push_back(Matrix2D::matrixAddition(Matrix2D::matrixMultiplication(first_hidden_weights, input_nodes), hidden_biases[0]).swishMatrix());
                      //This is the line where I get the error
                      //no matching function for call to 'std::vector&lt;Matrix2D&gt;::push_back(int)'|
                      
                  }
                  if(i!=0 &amp;&amp; i!=numberof_hidden_layers){
                      activated_hidden_nodes.push_back(Matrix2D::matrixAddition(Matrix2D::matrixMultiplication(hidden_weights[i-1], activated_hidden_nodes[i-1]), hidden_biases[i]).swishMatrix());  
                      //This is also a line where I get the error
                      //no matching function for call to 'std::vector&lt;Matrix2D&gt;::push_back(int)'|
                  }
                  if(i==numberof_hidden_layers){
                      //Not important
                  }
              }
          }
  </code></pre>
  <p>I might have missed some part of the code, it was hard to keep short, but all the needed variables are correctly assigned.</p>