Skip to content

Commit 44dd3c3

Browse files
authored
Merge pull request #229 from offa/217-cpp20
Update to C++20
2 parents e7f64d1 + 3091508 commit 44dd3c3

File tree

9 files changed

+12
-18
lines changed

9 files changed

+12
-18
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
conan profile detect
101101
echo "tools.cmake.cmaketoolchain:generator=Ninja" >> ~/.conan2/global.conf
102102
mkdir build
103-
conan install -o "influxdb_cxx/*":boost=${{ matrix.boost }} -o "influxdb_cxx/*":tests=True -s compiler.cppstd=17 --build=missing . -of build
103+
conan install -o "influxdb_cxx/*":boost=${{ matrix.boost }} -o "influxdb_cxx/*":tests=True -s compiler.cppstd=20 --build=missing . -of build
104104
conan install --build=missing -of build --requires "libcurl/7.87.0" --deployer full_deploy
105105
- name: Build
106106
run: |
@@ -128,7 +128,7 @@ jobs:
128128
brew install boost
129129
conan profile detect
130130
mkdir build
131-
conan install -o "influxdb_cxx/*":system=True -o "influxdb_cxx/*":tests=True -s compiler.cppstd=17 --build=missing . -of build
131+
conan install -o "influxdb_cxx/*":system=True -o "influxdb_cxx/*":tests=True -s compiler.cppstd=20 --build=missing . -of build
132132
- name: Build
133133
run: script/ci_build.sh
134134
- name: Install

.github/workflows/systemtest.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ jobs:
3636
- name: Setup
3737
run: |
3838
script/ci_setup.sh
39-
apt-get install -y libboost-system-dev
39+
add-apt-repository ppa:nicola-onorata/toolchain
40+
apt-get update
41+
apt-get install -y boost1.81
4042
- name: Build
4143
run: |
4244
cmake --preset conan-release

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if(NOT MSVC AND NOT INCLUDED_AS_SUBPROJECT)
4444
)
4545
endif()
4646

47-
set(CMAKE_CXX_STANDARD 17)
47+
set(CMAKE_CXX_STANDARD 20)
4848
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4949
set(CMAKE_CXX_EXTENSIONS OFF)
5050
# We explicitly export the public interface

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![ci](https://github.com/offa/influxdb-cxx/actions/workflows/ci.yml/badge.svg)](https://github.com/offa/influxdb-cxx/actions/workflows/ci.yml)
44
[![GitHub release](https://img.shields.io/github/release/offa/influxdb-cxx.svg)](https://github.com/offa/influxdb-cxx/releases)
55
[![License](https://img.shields.io/badge/license-MIT-yellow.svg)](LICENSE)
6-
![C++](https://img.shields.io/badge/c++-17-green.svg)
6+
![C++](https://img.shields.io/badge/c++-20-green.svg)
77
[![Conan Center](https://img.shields.io/conan/v/influxdb-cxx)](https://conan.io/center/recipes/influxdb-cxx)
88

99
InfluxDB C++ client library
@@ -21,11 +21,11 @@ InfluxDB C++ client library
2121

2222
### Build requirements
2323
- CMake 3.12+
24-
- C++17 compiler
24+
- C++20 compiler
2525

2626
### Dependencies
2727
- [**cpr**](https://github.com/libcpr/cpr) (required)<sup>i)</sup>
28-
- **boost 1.66+** (optional – see [Transports](#transports))
28+
- **boost 1.78+** (optional – see [Transports](#transports))
2929

3030
<sup>i)</sup> *cpr* needs to provide [CMake support](https://github.com/libcpr/cpr#find_package); some systems need to call `ldconfig` after *.so* installation.
3131

include/Point.h

-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <chrono>
3434
#include <variant>
3535
#include <deque>
36-
#include <type_traits>
3736

3837
#include "influxdb_export.h"
3938

@@ -56,12 +55,6 @@ namespace influxdb
5655
using FieldValue = std::variant<int, long long int, std::string, double, bool, unsigned int, unsigned long long int>;
5756
Point&& addField(std::string_view name, const FieldValue& value);
5857

59-
template <class T, class = std::enable_if_t<std::is_same_v<T, const char*>, int>>
60-
Point&& addField(std::string_view name, T value)
61-
{
62-
return this->addField(name, std::string{value});
63-
}
64-
6558
/// Sets custom timestamp
6659
Point&& setTimestamp(std::chrono::time_point<std::chrono::system_clock> timestamp);
6760

script/ci_setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ conan install \
2222
-of . \
2323
-o "influxdb_cxx/*":system=True \
2424
-o "influxdb_cxx/*":tests=True \
25-
-s compiler.cppstd=17 \
25+
-s compiler.cppstd=20 \
2626
--build=missing \
2727
..

script/ci_testdeploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ conan install \
2020
-g CMakeDeps \
2121
--build=missing \
2222
-s build_type=${BUILD_TYPE} \
23-
-s compiler.cppstd=17 \
23+
-s compiler.cppstd=20 \
2424
--requires=cpr/1.10.0
2525

2626
cmake -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" "$@" ..

src/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,4 @@ target_link_libraries(InfluxDB
8787
Threads::Threads
8888
)
8989

90-
# Use C++17
9190
target_compile_features(InfluxDB PUBLIC cxx_std_${CMAKE_CXX_STANDARD})

test_package/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ find_package(InfluxDB REQUIRED)
55

66
add_executable(test_package example.cpp)
77
target_link_libraries(test_package PRIVATE InfluxData::InfluxDB)
8-
target_compile_features(test_package PRIVATE cxx_std_17)
8+
target_compile_features(test_package PRIVATE cxx_std_20)

0 commit comments

Comments
 (0)