Will (and should) there be sockets in C++11?

前端 未结 6 1887
忘掉有多难
忘掉有多难 2021-02-01 00:16

Is the new C++11 going to contain any socket library? So that one could do something std::socket-ish?

Seeing as how std::thread will be added,

6条回答
  •  死守一世寂寞
    2021-02-01 01:00

    There will be no sockets in C++11. The difference between threads and sockets is that threads involves making more guarantees about ordering, if your program involves threads. For a platform with just one core, then C++11 doesn't mandate that your CPU springs an extra core. Sockets, on the other hand, would be... difficult to implement portably and fail gracefully on systems that don't have them.

提交回复
热议问题