title: Passing functions with multiple parameters as a template parameter
body: <h2>Original question</h2>
  
  <p>How can I pass a function <strong>with</strong> or <strong>without</strong> a parameter as a template?</p>
  
  <p>The reason been is that I've updated my <em><code>Queue</code> Data Structure</em> as I was told in my other question on how to <a href="https://stackoverflow.com/questions/51112395/determine-whether-function-parameter-is-a-function">determine whether a function parameter is a function</a>.</p>
  
  <p>Now, the only problem is that it only accepts functions without parameters. Is there a way I can improve it to accept multiple parameters?</p>
  
  <p>Here's my code:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>// Necessary includes:
  #include &lt;vector&gt;
  #include &lt;any&gt;
  
  // If the data is a function:
  void call_if_function(void (*function)()) {
      function();
  }
  
  // If the data is not a function:
  void call_if_function(std::any variable) {
      (void)variable;
  }
  
  template &lt;class T&gt;
  class Queue {
      // Public members:
      public:
          // Enqueue data:
          void Enqueue(const T&amp; data) {
              vec_.push_back(data);
          }
  
          // Dequeue data:
          void Dequeue() {
              T holder = vec_.front();
  
              vec_.erase(vec_.begin());
  
              call_if_function(holder);
          }
  
      // Private members:
      private:
          std::vector&lt;T&gt; vec_;
  }
  </code></pre>
  
  <h2>Edited question</h2>
  
  <p>During continuous tests, I eventually tried using templates. But I'm not sure how to check if a templated variable is existing.</p>