Better HN
topnewbestaskshowjobs
Log inSign up

ipkn

34 karma · joined Jan 21, 2014 (12y ago) · 8 submissions

Submissions

1.

Show HN: Sound playground implemented in C++ Crow WebSocket(sound.ipknlab.com ↗)

5 points · by ipkn · 10y ago · discuss

comment 12y ago · link · parent

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");
    });

comment 12y ago · link · parent

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.

comment 12y ago · link · parent

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.

comment 12y ago · link · parent

the power of `constexpr'!

comment 12y ago · link · parent

I'm writer of this project and it's not completed yet. I planned to publish this after finishing basic features and documentations.

comment 12y ago · link · parent

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

8.

Serialization without any serialization codes in C++(github.com ↗)

1 points · by ipkn · 12y ago · discuss