Boost C++ Libraries 是一个提供免费同行评审便携式C++源代码库的开源项目。项目强调与C++标准库的良好协作,旨在提供广泛适用且跨多种应用场景的高质量库。Boost许可证鼓励商业和非商业使用,且二进制使用无需署名。
brew install boost
#include <boost/array.hpp>
#include <iostream>
int main() {
boost::array<int, 4> arr = {1, 2, 3, 4};
for (auto i : arr) {
std::cout << i << " ";
}
return 0;
}
Boost库提供统一的头文件包含方式,大多数库只需包含相应的头文件即可使用:
#include <boost/library_name.hpp>
#!/bin/sh
# Boost配置脚本核心部分
# 处理安装前缀选项
case $option in
-prefix=* | --prefix=*)
PREFIX=`expr "x$option" : "x-*prefix=\(.*\)"`
;;
-with-libraries=* | --with-libraries=* )
library_list=`expr "x$option" : "x-*with-libraries=\(.*\)"`
if test "$library_list" != "all"; then
old_IFS=$IFS
IFS=,
for library in $library_list
do
LIBS="$LIBS $library"
done
fi
;;
esac
#!/usr/bin/env python
# 库组织结构检查工具
class check_library():
'''
Boost库组织结构检查工具,验证库是否符合Boost项目规范
'''
def check_organization_build(self):
# 检查构建目录结构
if os.path.isdir(os.path.join(self.library_dir, 'build')):
self.assert_file_exists(
os.path.join(self.library_dir, 'build'),
self.jamfile,
'缺少Boost Build文件',
'org-build-ok'
)
<!DOCTYPE html>
<!-- 自动文档重定向系统 -->
<head>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/array.html">
<title>Redirect to generated documentation</title>
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/array.html">
Boost.Array Documentation
</a>
</body>
#!/bin/bash
# CircleCI自动化构建取消脚本
# 获取工作流信息
curl --header "Circle-Token: $PERS_API_TOKEN_BOOST_5" \
--request GET "https://circleci.com/api/v2/workflow/${CIRCLE_WORKFLOW_ID}" \
-o current_workflow.json
# 取消重复的构建工作流
if [ -s WF_to_cancel.txt ]; then
while read WF_ID;
do
curl --header "Circle-Token: $PERS_API_TOKEN_BOOST_5" \
--request POST https://circleci.com/api/v2/workflow/$WF_ID/cancel
done < WF_to_cancel.txt
fi
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。