Why is std::filesystem::u8path deprecated in c++20?

前端 未结 1 475
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-12 12:35

Introduced in c++17, std::filesystem::u8path seems to be deprecated in c++20.

What is the reason for this choice? What should I use in c++17? What should I

1条回答
  •  执笔经年
    2021-02-12 13:20

    Because, thanks to the existence of the C++20 feature char8_t, this will work:

    path p(u8"A/utf8/path");
    

    u8path existed to allow the detection of the difference between a UTF-8 string and a narrow character string. But since C++20 will give us an actual type for that, it is no longer necessary.


    What should I use in c++17?

    Use u8path. Deprecation does not mean removed or inaccessible. It merely means subject to eventual removal.

    0 讨论(0)
提交回复
热议问题