V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
taozhijiangscu
V2EX  ›  C

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

  •  
  •   taozhijiangscu · 2016-09-01 16:54:57 +08:00 · 1578 次点击
    这是一个创建于 2793 天前的主题,其中的信息可能已经有所发展或是发生改变。
    其实就是把 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 条回复    2016-09-24 19:13:48 +08:00
    onemoo
        1
    onemoo  
       2016-09-24 19:13:48 +08:00
    虽然能编译通过,但至少会有 warning 啊。如果不放过任何一个警告的话,还是能够发现的。

    再有,这代码能编译通过也是因为暴露了 std 命名空间中的 string 吧。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5431 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 08:47 · PVG 16:47 · LAX 01:47 · JFK 04:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.