Skip to content

Instantly share code, notes, and snippets.

@Superlokkus
Last active September 8, 2015 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Superlokkus/fac974528a3831adf165 to your computer and use it in GitHub Desktop.
Save Superlokkus/fac974528a3831adf165 to your computer and use it in GitHub Desktop.
Wt bind problem
namespace detail {
namespace function {
template<
typename FunctionPtr,
typename R BOOST_FUNCTION_COMMA
BOOST_FUNCTION_TEMPLATE_PARMS
>
struct BOOST_FUNCTION_FUNCTION_INVOKER
{
static R invoke(function_buffer& function_ptr BOOST_FUNCTION_COMMA
BOOST_FUNCTION_PARMS)
{
FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
return f(BOOST_FUNCTION_ARGS);//<-THIS LINE
}
};
Error 94 error C2198: 'Wt::WApplication *(__cdecl *)(const Wt::WEnvironment &,int)' : too few arguments for call c:\users\klm\downloads\wt-3.3.4-msvs2013-windows-x86-sdk\include\boost\function\function_template.hpp 95 1 MDDB_Web
#include <iostream>
#include <functional>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <Wt/WServer>
Wt::WApplication *createApplication(const Wt::WEnvironment& env, int i) {
return new Wt::WApplication(env);
}
int main(int argc, char** argv)
{
Wt::WRun(argc, argv,std::bind(&createApplication, std::placeholders::_1, 1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment