News for hackers. Stuff that matters.

ipkn

I agree that allowing implementing long polling with crow is important, just I didn't know a good way to do that. Your suggestion is big help.

I think supporting both way is better if there is a enough explanation. I don't want to drop a simpler way to do the same job.

  CROW_ROUTE(app, "/about")
    ([](){
        return "About Crow example";
    });

  CROW_ROUTE(app, "/about")
    ([](Response res){
        res.send("About Crow example");
    });
I already considered using a template with single character constants, and I thought the technic didn't have much benefit over the macro version. Maybe compile-time routing function genetation could be possible with it (and would faster), but requres HUGE work I think. I will try and benchmark it later.
I also want to remove CROW_ROUTE, but with the current c++ standard, it cannot be avoided.

To check whether handler is valid with given URL at compile time, `url' (string literal) argument requires in compile time and in run time. const char* value is invalid for template argument and argument of non-constexpr function cannot be constexpr value. Thus I used macro to provied `url' argument twice; in template argument through constexpr function and in argument.

the power of `constexpr'!
I'm writer of this project and it's not completed yet. I planned to publish this after finishing basic features and documentations.
Re:FlatBuffers: a memory efficient serialization library on Monday June 16, 2014 @10:42PM (#7902616)
If you don't want the code generation step and C++ is the only language to use, Dumpable[1] can be useful.

[1]https://github.com/ipkn/dumpable