Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
name: ${{ matrix.preset }} / ${{ matrix.os }} / ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.compiler == 'gcc' && 'gcc' || 'clang' }}
CXX: ${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }}
CC: ${{ matrix.compiler == 'gcc' && 'gcc-14' || 'clang' }}
CXX: ${{ matrix.compiler == 'gcc' && 'g++-14' || 'clang++' }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 200M
strategy:
Expand All @@ -43,6 +43,9 @@ jobs:
name: Load CI env
shell: bash
run: cat .github/ci.env >> "$GITHUB_ENV"
- name: Install GCC 14
if: runner.os == 'Linux' && matrix.compiler == 'gcc'
run: sudo apt-get update && sudo apt-get install -y gcc-14 g++-14
- uses: conan-io/setup-conan@v1
with:
version: ${{ env.CONAN_VERSION }}
Expand Down Expand Up @@ -101,18 +104,19 @@ jobs:
name: coverage / ubuntu-latest / gcc
runs-on: ubuntu-latest
env:
CC: gcc
CXX: g++
CC: gcc-14
CXX: g++-14
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 200M
GCOV_EXECUTABLE: gcov-14
steps:
- uses: actions/checkout@v7
- *load-ci-env
- run: sudo apt-get update && sudo apt-get install -y ccache mold gcc-14 g++-14
- uses: conan-io/setup-conan@v1
with:
version: ${{ env.CONAN_VERSION }}
cache_packages: true
- run: sudo apt-get update && sudo apt-get install -y ccache mold
- uses: actions/cache@v6
with:
path: .ccache
Expand All @@ -129,6 +133,9 @@ jobs:

lint:
runs-on: ubuntu-latest
env:
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v7
- *load-ci-env
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
analyze:
name: codeql / ubuntu-latest / cpp
runs-on: ubuntu-latest
env:
CC: gcc-14
CXX: g++-14
permissions:
actions: read
contents: read
Expand All @@ -29,6 +32,7 @@ jobs:
# Tool pins live in .github/ci.env, shared across workflows.
- name: Load CI env
run: cat .github/ci.env >> "$GITHUB_ENV"
- run: sudo apt-get update && sudo apt-get install -y gcc-14 g++-14
- uses: github/codeql-action/init@v4
with:
languages: c-cpp
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ jobs:
name: rename / ubuntu-latest / gcc
runs-on: ubuntu-latest
env:
CC: gcc
CXX: g++
CC: gcc-14
CXX: g++-14
steps:
- uses: actions/checkout@v7
# Tool pins live in .github/ci.env, shared across workflows
- name: Load CI env
run: cat .github/ci.env >> "$GITHUB_ENV"
- run: sudo apt-get update && sudo apt-get install -y gcc-14 g++-14
- uses: conan-io/setup-conan@v1
with:
version: ${{ env.CONAN_VERSION }}
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project(
include(CTest)

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_COLOR_DIAGNOSTICS
ON
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ stable across toolchain changes.
- [mold](https://github.com/rui314/mold) or [LLD](https://lld.llvm.org/) (optional, Linux only; used
automatically to link first-party targets when on PATH, with mold preferred)
- [Doxygen](https://www.doxygen.nl) (optional; required only for `make docs`)
- A compiler and standard library with working C++23 support
- [GCC](https://gcc.gnu.org/) 13+
- [LLVM Clang](https://llvm.org/) 17+
- A compiler and standard library with C++23 `std::ranges::to` support
- [GCC](https://gcc.gnu.org/) 14+
- [LLVM Clang](https://llvm.org/) 17+ with libc++ 17+ or libstdc++ 14+
- [Apple Clang](https://developer.apple.com/xcode/) 17+ recommended
- [MSVC](https://visualstudio.microsoft.com/) 2022 (17.10+) on Windows

Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void run()
// NOLINTNEXTLINE(bugprone-exception-escape)
int main(int argc, char* argv[])
{
CLI::App app{"C++23 project template demo"};
CLI::App app{"C++23 project template"};
app.set_version_flag("--version", std::string{cpp_boilerplate::version});

try {
Expand Down
8 changes: 6 additions & 2 deletions src/split.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#include <cpp_boilerplate/split.hpp>

#include <ranges>
#include <string_view>
#include <vector>

#if !defined(__cpp_lib_ranges_to_container) || __cpp_lib_ranges_to_container < 202202L
#error "cpp-boilerplate requires C++23 std::ranges::to support"
#endif

namespace cpp_boilerplate {

std::vector<std::string_view> split_views_vec(std::string_view record, char delimiter)
{
auto view = split_views(record, delimiter);
return {view.begin(), view.end()};
return std::ranges::to<std::vector>(split_views(record, delimiter));
}

} // namespace cpp_boilerplate
Loading