V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
taozhijiangscu
V2EX  ›  C

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

  •  
  •   taozhijiangscu · Sep 1, 2016 · 2139 views
    This topic created in 3536 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
        1
    onemoo  
       Sep 24, 2016
    虽然能编译通过,但至少会有 warning 啊。如果不放过任何一个警告的话,还是能够发现的。

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