Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
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