title: passing a functor to a constructor in C++
body: <p>Would that be possible to help me to pass a functor, such as :</p>
  
  <pre><code>struct BFunc
  {
      double operator()(const double x, const double y, const double z){
          return 0.1;
          }
  };
  </code></pre>
  
  <p>to a the constructor of a class:</p>
  
  <pre><code>class foo
  {
      int n;
  public:
  foo();
  foo(int nn, &amp;bfunc):n(nn),f(func()){        
      } 
  double getResult(double x){
          return f(x);
      }   
  }
  </code></pre>
  
  <p>Thanks,</p>