taozhijiangscu
V2EX  ›  C

这个代码都能编译通过,好恐怖。。。

  •  
  •   taozhijiangscu · Sep 1, 2016 · 2392 views
    This topic created in 3716 days ago, the information mentioned may be changed or developed.
    其实就是把 std 当成了个标签吧

    --- a/source/http_parser.cpp
    +++ b/source/http_parser.cpp
    @@ -16,7 +16,7 @@ namespace airobot {
    return false;
    }

    - std:string header = std::string(ptr);
    + std::string header = std::string(ptr);
    assert(boost::find_first(header, "\r\n\r\n")); //boost algo
    header_opts_.clear();
    1 replies  •  2016-09-24 19:13:48 +08:00
    onemoo
    onemoo
    Sep 24, 2016
    1
    虽然能编译通过,但至少会有 warning 啊。如果不放过任何一个警告的话,还是能够发现的。

    再有,这代码能编译通过也是因为暴露了 std 命名空间中的 string 吧。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3868 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 05:34 · PVG 13:34 · LAX 21:34 · JFK 00:34
    ♥ Do have faith in what you're doing.