繁体   English   中英

如何设置标志(cpp-netlib)

[英]how to set a flag (cpp-netlib)

我认为我的问题非常简单,但我无法让它继续工作

std::string url="www.google.it";

boost::network::http::client client1_(_follow_redirects=true, _cache_resolved=true);
boost::network::http::client::request req(url);
boost::network::http::client::response resp = client1_.get(req);
std::cout << "Body: " << body(resp) << std::endl;

return 0;

错误当然是指标志的声明......但我怎样才能设置它们?

/home/snake91/cpp_pricing/underlying.cpp:67: error: C++ requires a type specifier for all declarations
    boost::network::http::client client1_(_follow_redirects=true, _cache_resolved=true);

^
client::options options;
options.follow_redirects(true)
       .cache_resolved(true);

client client1_(options);

从这个文档的页面: http//cpp-netlib.org/0.11.0/reference/http_client.html#general

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM