Skip to content

Commit

Permalink
Option to disable C++20 concepts code
Browse files Browse the repository at this point in the history
  • Loading branch information
antonysigma committed Jul 23, 2023
1 parent 9900f76 commit 4c4ede1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ option(HIGHFIVE_PARALLEL_HDF5 "Enable Parallel HDF5 support" OFF)
option(HIGHFIVE_BUILD_DOCS "Enable documentation building" ON)
option(HIGHFIVE_VERBOSE "Set logging level to verbose." OFF)
option(HIGHFIVE_GLIBCXX_ASSERTIONS "Enable bounds check for STL." OFF)
option(HIGHFIVE_HAS_CONCEPTS "Print readable compiler errors w/ C++20 concepts" ON)

# Controls if HighFive classes are friends of each other.
#
Expand Down Expand Up @@ -92,6 +93,10 @@ endif()

add_compile_definitions(HIGHFIVE_CXX_STD=${CMAKE_CXX_STANDARD})

if(HIGHFIVE_USE_CONCEPTS AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)
add_compile_definitions(HIGHFIVE_HAS_CONCEPTS)
endif()

# Search dependencies (hdf5, boost, eigen, xtensor, mpi) and build target highfive_deps
include(${PROJECT_SOURCE_DIR}/CMake/HighFiveTargetDeps.cmake)

Expand Down
2 changes: 1 addition & 1 deletion include/highfive/H5PropertyList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class PropertyListBase: public Object {
/// \sa Instructions to document C++20 concepts with Doxygen: https://github.com/doxygen/doxygen/issues/2732#issuecomment-509629967
///
/// \cond
#if __cplusplus >= 202002L
#if HIGHFIVE_HAS_CONCEPTS && __cplusplus >= 202002L
template <typename P>
concept PropertyInterface = requires(P p, const hid_t hid) {
{p.apply(hid)};
Expand Down

0 comments on commit 4c4ede1

Please sign in to comment.