cnl
Bella

组成数字库(CNL)是固定精确数字类的C ++库,可增强整数以提供更安全,更简单,更便宜的算术类型。文档可以在这里找到。您可以在此处尝试CONLER Explorer上的CNL。
CNL特别适合:
CNL的最新版本需要C ++ 20兼容的工具链。 (版本1.x支持C ++ 11。)CNL在以下系统上不断测试:
测试:
测试:
测试:
提供了cmake脚本。
mkdir build && cd build
cmake ..
cmake --build . --target install注意:您可能需要用户特权来安装库。另外,您可以使用CMAKE_INSTALL_PREFIX安装到用户目录:
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX:FILE=/home/username/someplace ..
cmake --build . --target install另外,CNL是仅标头库
c++ -isystem /path/to/cnl/include -std=c++20 my_program.cpp甚至直接在您的代码中包含根标头:
# include " /path/to/cnl/include/cnl/all.h "该测试套件使用CMAKE,并取决于Google Test和Google基准测试。可选集成测试使用Boost.MultipRecision。
柯南可用于拉动基本依赖性。此示例假设海湾合作委员会,但提供了其他工具链文件:
cd build
conan profile new --detect --force default
conan profile update settings.compiler.libcxx=libstdc++11 default # GCC/Clang only
conan profile update env.CONAN_CMAKE_TOOLCHAIN_FILE=../test/toolchain/gcc.cmake default # GCC only
conan install --build=missing --options test=unit .....然后配置,构建和运行单元测试:
conan build --configure --build --test ..要运行基准测试,请使用--options test=benchmark ...
conan install --build=missing --options test=benchmark ..然后配置和构建
conan build --configure --build ..并最终明确运行以查看结果。
./test/benchmark/test-benchmarkAPI通过包含目录中的标头暴露。将其添加到您的系统标题列表中,并包括:例如:
// to use a specific type:
# include < cnl/scaled_integer.h >
// or to include all CNL types:
# include < cnl/all.h > 使用CNL的项目示例:
所有反馈都非常感谢。