title: Boost.Bind non-static member
body: <p>I have the following code, in which Boost.Local uses a function callback to load a mo file. The function is called findMo for me, and I'm trying to bind it to an object so I can retain the side effects I put in private members of moFinder.</p>
  
  <pre><code>class moFinder
  {
    public:
      moFinder(string const&amp; wantedFormat)
      : format(wantedFormat)
      {
        // ...
      }
  
      std::vector&lt;char&gt; findMo(std::string const&amp; filePath, std::string const&amp; encoding)
      {
        // ...
      }
  };
  
  std::locale createLocale(string const&amp; name, string const&amp; customTranslation,
    string const&amp; path, string const&amp; domain, string const&amp; pathFormat)
  {
    // ...
  
    namespace blg = boost::locale::gnu_gettext;
    blg::messages_info info;
    info.paths.push_back(path);
    info.domains.push_back(blg::messages_info::domain(domain));
  
    moFinder finder(pathFormat);
  
    blg::messages_info::callback_type callbackFunc;
    callbackFunc = boost::bind(moFinder::findMo, boost::ref(finder));
  
    info.callback = callbackFunc;
  
    // ...
  }
  </code></pre>
  
  <p>When compiling I get the following error:</p>
  
  <blockquote>
    <p>error: invalid use of non-static member function ‘std::vector moFinder::findMo(const std::string&amp;, const std::string&amp;)’</p>
  </blockquote>
  
  <p>At the line where I call boost::bind.</p>
  
  <p>What am I doing to deserve this error?</p>