title: Invalid use of non-static member function in constructor
body: <p>I have this class:</p>
  
  <pre><code>class Displayer
  {
  public:
    enum FlagDisplay { NOT_DISPLAY, DISPLAY };
  
    Displayer() {}
    ~Displayer() {}
  
    Displayer::FlagDisplay bar1() const { return DISPLAY; }
    Displayer::FlagDisplay bar2() const { return NOT_DISPLAY; }
  
    void displayImg(const cv::Mat&amp; image, const std::string&amp; name, FlagDisplay flg)
    {
      if (flg == DISPLAY)
      {
        cv::imshow(name, image);
        cv::waitKey();
      }
    }
  
    void closeAllWindows() { cv::destroyAllWindows(); }
  };
  </code></pre>
  
  <p>And I have another class that has a member of type <code>Displayer</code>. When I try to initialize it in the constructor I get an <code>error: invalid use of non-static member function</code>. I do not see any call of functions in the <em>static manner</em> (<code>Displayer::</code>). Because the code is very big, what else shall I search for to find the problem?</p>
  
  <hr>
  
  <p>The constructor of the class is this:</p>
  
  <pre><code>RunSolution::RunSolution(const cv::BOWImgDescriptorExtractor&amp; bowDEIn, const ConfigFile&amp; configFileIn,
                           const Auth&amp; authIn, const ClassifierPtr&amp; classifierIn, const Displayer&amp; displayerIn)
    : m_bowDE(bowDEIn),
      m_configFile(configFileIn),
      m_io(m_configFile.getOutputFolder),
      m_s3Service(authIn),
      m_classifier(classifierIn),
      m_detector(cv::FeatureDetector::create(m_configFile.getClassifierDetectorType())),
      m_display(displayerIn) {}
  //     error here       ^^
  </code></pre>