Skip to content

problem using HttpServerRequestRouter with Visual Studio #79

@hmoffatt

Description

@hmoffatt

I'm having trouble using HttpServerRequestRouter with the VS compiler. I can't compile the sessionusage example. It gives the unhelpful error

1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xrefwrap(283): error C2064: term does not evaluate to a function taking 2 arguments

due to the mapping lines (main.cpp:52-54)

{QRegularExpression{"^/set(?:/(\\w*))?$"}, setHandler},
{QRegularExpression{"^/read(?:/(\\w*))?$"}, readHandler},
{QRegularExpression{"^/unset(?:/(\\w*))?$"}, unsetHandler},

This simple code doesn't compile

Tufao::NotFoundHandler notfound;
Tufao::HttpServerRequestRouter::Mapping m;
m.handler = notfound;

Unfortunately if you Google "vs 2013 xrefwrap _Ret std::_Callable_obj" you get heaps of errors like this one. Seems to be a problem with std::function in VS 2013 with no simple workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions