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的項目示例:
所有反饋都非常感謝。