简体   繁体   English

对数字范围使用 boost

[英]Using boost for numeric ranges

I have this simple code:我有这个简单的代码:

for (auto const& i : boost::counting_range(1, 5)) {
    CString strSlipsPerPage;
    strSlipsPerPage.Format(IDS_TPL_SLIPS_PER_PAGE, i);
    m_cbStatusBarSlipsPerPage.AddString(strSlipsPerPage);
}

Is there any way to specify that the range is up to and including the final number?有没有办法指定范围最多并包括最终数字? Other than increasing it to one more than you want included?除了将它增加到比您想要的多一个吗?

According official documentation and realisation I can say no.根据官方文档实现,我可以说不。

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

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