Skip to content

Commit

Permalink
Merge pull request #547 from LebedevRI/cxx20
Browse files Browse the repository at this point in the history
Bump to C++20
  • Loading branch information
LebedevRI authored Nov 5, 2023
2 parents fcdc06a + f66e171 commit 8d72819
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
Language: Cpp
BasedOnStyle: LLVM
Standard: c++17
Standard: c++20
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left
Expand Down
2 changes: 1 addition & 1 deletion cmake/clang-tidy.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
find_package(LLVMClangTidy REQUIRED)

set(CMAKE_CXX_CLANG_TIDY "${CLANGTIDY_PATH}" -extra-arg=-Wno-unknown-warning-option)
set(CMAKE_CXX_CLANG_TIDY "${CLANGTIDY_PATH}" -extra-arg=-Wno-unknown-warning-option -extra-arg=-Wno-unknown-pragmas)
2 changes: 1 addition & 1 deletion cmake/compiler-flags.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include(CpuMarch)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand Down
2 changes: 1 addition & 1 deletion cmake/src-dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(BUILD_BENCHMARKING)
add_dependencies(dependencies benchmark)
endif()

target_compile_features(rawspeed PUBLIC cxx_std_17)
target_compile_features(rawspeed PUBLIC cxx_std_20)

unset(HAVE_OPENMP)
if(WITH_OPENMP)
Expand Down
3 changes: 1 addition & 2 deletions src/librawspeed/adt/DefaultInitAllocatorAdaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

namespace rawspeed {

template <typename T, typename ActualAllocator = std::allocator<T>,
typename = std::enable_if_t<std::is_pod_v<T>>>
template <typename T, typename ActualAllocator = std::allocator<T>>
class DefaultInitAllocatorAdaptor {
public:
using allocator_traits = std::allocator_traits<ActualAllocator>;
Expand Down
5 changes: 2 additions & 3 deletions src/librawspeed/tiff/CiffIFD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -231,13 +230,13 @@ CiffIFD::getIFDsWithTagWhere(CiffTag tag, const std::string& isValue) const {
bool RAWSPEED_READONLY CiffIFD::hasEntry(CiffTag tag) const {
assert(isIn(tag, CiffTagsWeCareAbout));

return mEntry.count(tag) > 0;
return mEntry.contains(tag);
}

bool RAWSPEED_READONLY CiffIFD::hasEntryRecursive(CiffTag tag) const {
assert(isIn(tag, CiffTagsWeCareAbout));

if (mEntry.count(tag) > 0)
if (mEntry.contains(tag))
return true;

return std::any_of(mSubIFD.begin(), mSubIFD.end(),
Expand Down

0 comments on commit 8d72819

Please sign in to comment.