使用boost::counting_range的测试程序(C/C++)

177 篇文章 ¥59.90 ¥99.00
本文展示了如何在C/C++中利用Boost库的counting_range生成并遍历数字范围。首先,引入相关头文件,然后创建包含10个整数的向量,接着使用counting_range生成范围对象,通过范围遍历循环打印这些元素,方便处理连续整数序列。
#include <iostream>
#include <vector>
#include <boost/range/counting_range.hpp>

int main() 
the Meson build system Version: 1.5.1 Source dir: /home/huawei/libcamera Build dir: /home/huawei/libcamera/build Build type: native build Project name: libcamera Project version: 0.5.2 C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14+deb12u1) 12.2.0") C linker for the host machine: cc ld.bfd 2.40 C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14+deb12u1) 12.2.0") C++ linker for the host machine: c++ ld.bfd 2.40 Host machine cpu family: aarch64 Host machine cpu: aarch64 Header "unistd.h" has symbol "close_range" : YES Header "fcntl.h" has symbol "F_ADD_SEALS" : YES Header "unistd.h" has symbol "issetugid" : NO Header "locale.h" has symbol "locale_t" : YES Header "sys/mman.h" has symbol "memfd_create" : YES Header "stdlib.h" has symbol "secure_getenv" : YES Compiler for C supports arguments -Wno-c99-designator: NO Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1 Found CMake: /usr/bin/cmake (3.25.1) Run-time dependency lttng-ust found: NO (tried pkgconfig and cmake) Program ./parser.py found: YES (/home/huawei/libcamera/utils/codegen/ipc/./parser.py) Program ./generate.py found: YES (/home/huawei/libcamera/utils/codegen/ipc/./generate.py) Program ./extract-docs.py found: YES (/home/huawei/libcamera/utils/codegen/ipc/./extract-docs.py) Configuring version.h using configuration Program openssl found: YES (/usr/bin/openssl) Run-time dependency libyuv found: NO (tried pkgconfig and cmake) Has header "libyuv.h" : NO Library atomic found: YES Run-time dependency threads found: YES Run-time dependency libdw found: NO (tried pkgconfig and cmake) Run-time dependency libunwind found: NO (tried pkgconfig and cmake) Header "execinfo.h" has symbol "backtrace" : YES Library rt found: YES Run-time dependency libpisp found: NO (tried pkgconfig and cmake) Looking for a fallback subproject for the dependency libpisp Cloning into 'libpisp'... remote: Enumerating objects: 101, done. remote: Counting objects: 100% (101/101), done. remote: Compressing objects: 100% (97/97), done. remote: Total 101 (delta 5), reused 51 (delta 1), pack-reused 0 (from 0) Receiving objects: 100% (101/101), 110.54 KiB | 385.00 KiB/s, done. Resolving deltas: 100% (5/5), done. Executing subproject libpisp libpisp| Project name: libpisp libpisp| Project version: 1.2.1 libpisp| C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14+deb12u1) 12.2.0") libpisp| C linker for the host machine: cc ld.bfd 2.40 libpisp| C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14+deb12u1) 12.2.0") libpisp| C++ linker for the host machine: c++ ld.bfd 2.40 libpisp| Configuring pisp_build_config.h using configuration libpisp| Run-time dependency nlohmann_json found: NO (tried pkgconfig and cmake) libpisp| Looking for a fallback subproject for the dependency nlohmann_json libpisp| Using subprojects/libpisp/subprojects/nlohmann_json.wrap libpisp| Downloading nlohmann_json source from https://github.com/nlohmann/json/releases/download/v3.11.2/include.zip Downloading: 100%|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 287k/287k 1.05MB/s eta 00:00 Executing subproject libpisp:nlohmann_json nlohmann_json| Project name: nlohmann_json nlohmann_json| Project version: 3.11.2 nlohmann_json| C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14+deb12u1) 12.2.0") nlohmann_json| C++ linker for the host machine: c++ ld.bfd 2.40 nlohmann_json| Build targets in project: 37 nlohmann_json| Subproject nlohmann_json finished. libpisp| Dependency nlohmann_json from subproject subprojects/nlohmann_json-3.11.2 found: YES 3.11.2 libpisp| Dependency threads found: YES unknown (cached) libpisp| Library dl found: YES libpisp| Run-time dependency Boost (found: log, log_setup, thread | missing: system) found: NO (tried system) libpisp| Build targets in project: 39 libpisp| Subproject libpisp finished. Dependency libpisp from subproject subprojects/libpisp found: YES 1.2.1 Checking for function "dlopen" : YES Run-time dependency libudev found: NO (tried pkgconfig and cmake) Run-time dependency yaml-0.1 found: YES 0.2.5 Run-time dependency gnutls found: NO (tried pkgconfig and cmake) Run-time dependency libcrypto found: NO (tried pkgconfig, system and cmake) src/libcamera/meson.build:104: WARNING: Neither gnutls nor libcrypto found, all IPA modules will be isolated Dependency libexif skipped: feature android disabled Dependency libjpeg skipped: feature android disabled Run-time dependency libevent_pthreads found: YES 2.1.12-stable Run-time dependency libtiff-4 found: YES 4.5.0 Run-time dependency GTest found: NO (tried pkgconfig and system) Looking for a fallback subproject for the dependency gtest Downloading gtest source from https://github.com/google/googletest/archive/release-1.11.0.zip <urlopen error timed out> WARNING: failed to download with error: could not get https://github.com/google/googletest/archive/release-1.11.0.zip is the internet available?. Trying after a delay... Downloading: 100%|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻坾 1.07M/1.07M 731kB/s eta 00:00 Downloading gtest patch from https://wrapdb.mesonbuild.com/v2/gtest_1.11.0-1/get_patch Downloading: 100%|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻坾 2.46k/2.46k 491kB/s eta 00:00 Executing subproject gtest gtest| Project name: gtest gtest| Project version: 1.11.0 gtest| C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14+deb12u1) 12.2.0") gtest| C++ linker for the host machine: c++ ld.bfd 2.40 gtest| Dependency threads found: YES unknown (cached) gtest| Dependency threads found: YES unknown (cached) gtest| Dependency threads found: YES unknown (cached) gtest| Dependency threads found: YES unknown (cached) gtest| Build targets in project: 71 gtest| Subproject gtest finished. Dependency gtest from subproject subprojects/googletest-release-1.11.0 found: YES 1.11.0 Run-time dependency libdrm found: YES 2.4.123 Run-time dependency libjpeg found: YES 2.1.5 sdl2-config found: NO Run-time dependency sdl2 found: NO (tried pkgconfig, config-tool and cmake) Run-time dependency qt6 (modules: Core, Gui, OpenGL, OpenGLWidgets, Widgets) found: NO (tried pkgconfig) Run-time dependency glib-2.0 found: YES 2.74.6 Run-time dependency gstreamer-video-1.0 found: NO (tried pkgconfig and cmake) Run-time dependency gstreamer-allocators-1.0 found: NO (tried pkgconfig and cmake) Run-time dependency python3 found: YES 3.11 pybind11-config found: NO Run-time dependency pybind11 found: NO (tried pkgconfig, config-tool and cmake) Configuring libcamerify using configuration Program doxygen found: NO Program dot found: NO Program sphinx-build-3 sphinx-build found: NO Configuring config.h using configuration Program python3 (jinja2, yaml, jinja2, ply) found: NO modules: jinja2, jinja2 meson.build:288:7: ERROR: python3 is missing modules: yaml, ply A full log can be found at /home/huawei/libcamera/build/meson-logs/meson-log.txt WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
08-09
fuyu1@ubuntu:~/code/nt9853x_project/platform/nvmp$ git fetch ssh://fuyu1@gerrit.ep.tp-link.com:29418/vigi/ipc/platform refs/changes/18/221918/1 && git cherry-pick FETCH_HEAD remote: Counting objects: 23286, done remote: Finding sources: 100% (150/150) remote: Total 150 (delta 69), reused 98 (delta 69) Receiving objects: 100% (150/150), 102.18 KiB | 0 bytes/s, done. Resolving deltas: 100% (69/69), completed with 59 local objects. From ssh://gerrit.ep.tp-link.com:29418/vigi/ipc/platform * branch refs/changes/18/221918/1 -> FETCH_HEAD warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/vframe.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/vdr_utils.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/vdr_rt_fr.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/vdr_pd_dla.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/vdr_od_bgm_w.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/trajectory_common.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/trajectory.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/tpaecns.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/sub_vframe.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/pd_common.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/object.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/ns.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/libdla.so (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/irframe.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/gmm.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/fg_neon.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/fg_common.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/dla.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/bgm_common.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/audio_common.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/ams.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/aframe.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) warning: Cannot merge binary files: nvmp/tp_package/ams/nvmp_artifact/lib/accesscontrol/aec.a (HEAD vs. eac5f03... [accesscontrol] auto update ams lib from jenkins) error: could not apply eac5f03... [accesscontrol] auto update ams lib from jenkins hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' hint: and commit the result with 'git commit' fuyu1@ubuntu:~/code/nt9853x_project/platform/nvmp$ git fetch ssh://fuyu1@gerrit.ep.tp-link.com:29418/vigi/ipc/platform refs/changes/18/221918/1 && git cherry-pick FETCH_HEAD From ssh://gerrit.ep.tp-link.com:29418/vigi/ipc/platform * branch refs/changes/18/221918/1 -> FETCH_HEAD error: cherry-pick is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm <file>' hint: as appropriate to mark resolution and make a commit. fatal: cherry-pick failed
10-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值