PrevUpHomeNext

error C2064: term does not evaluate to a function taking 2 arguments

Niall Douglas provides these notes:

If you see Microsoft Visual C++ 7.1 (MS Visual Studio .NET 2003) issue an error message like the following it is most likely due to a bug in the compiler:

boost\boost\python\detail\invoke.hpp(76):
error C2064: term does not evaluate to a function taking 2 arguments"

This message is triggered by code like the following:

#include <boost/python.hpp>

using namespace boost::python;

class FXThread
{
public:
  bool setAutoDelete(bool doso) throw();
};

void Export_FXThread()
{
  class_< FXThread >("FXThread")
      .def("setAutoDelete", &amp;FXThread::setAutoDelete)
  ;
}

The bug is related to the throw() modifier. As a workaround cast off the modifier. E.g.:

.def("setAutoDelete", (bool (FXThread::*)(bool)) &FXThread::setAutoDelete)

(The bug has been reported to Microsoft.)


PrevUpHomeNext