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
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(FetchContent)
include(CompilerFeatureTest)

beman_iterator26_check_deducing_this(COMPILER_SUPPORTS_DEDUCING_THIS)
beman_iterator_check_deducing_this(COMPILER_SUPPORTS_DEDUCING_THIS)

option(BEMAN_ITERATOR_INTERFACE26_USE_DEDUCING_THIS
option(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
"Make use of deducing this. Turn this off for non-conforming compilers."
${COMPILER_SUPPORTS_DEDUCING_THIS})

option(BEMAN_ITERATOR_INTERFACE26_ENABLE_TESTING "Build beman.iterator_interface26 tests" ${PROJECT_IS_TOP_LEVEL})
option(BEMAN_ITERATOR_INTERFACE_ENABLE_TESTING "Build beman.iterator_interface tests" ${PROJECT_IS_TOP_LEVEL})

if(BEMAN_ITERATOR_INTERFACE26_USE_DEDUCING_THIS AND NOT COMPILER_SUPPORTS_DEDUCING_THIS)
if(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS AND NOT COMPILER_SUPPORTS_DEDUCING_THIS)
message(WARNING "Building with deducing this support despite of the compiler's lack of support for it")
endif()

configure_file(
"${PROJECT_SOURCE_DIR}/include/beman/iterator_interface26/config.hpp.in"
"${PROJECT_BINARY_DIR}/include/beman/iterator_interface26/config.hpp"
"${PROJECT_SOURCE_DIR}/include/beman/iterator_interface/config.hpp.in"
"${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp"
@ONLY
)

if(BEMAN_ITERATOR_INTERFACE26_ENABLE_TESTING)
if(BEMAN_ITERATOR_INTERFACE_ENABLE_TESTING)
enable_testing()
endif()

set(TARGETS_EXPORT_NAME ${CMAKE_PROJECT_NAME}Targets)

add_subdirectory(extern)
add_subdirectory(src/beman/iterator_interface26)
add_subdirectory(src/beman/iterator_interface)
add_subdirectory(examples)

include(GNUInstallDirs)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Beman.iterator: C++26 Extensions for iterators
# beman.iterator\_interface: iterator creation mechanisms


**Implements**:
Expand Down
2 changes: 1 addition & 1 deletion cmake/CompilerFeatureTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include(CheckCXXSourceCompiles)

# Determines if the selected C++ compiler has deducing this support. Sets
# 'result_var' to whether support is detected.
function(beman_iterator26_check_deducing_this result_var)
function(beman_iterator_check_deducing_this result_var)
check_cxx_source_compiles( "
// clang-specific check due to http://github.com/llvm/llvm-project/issues/113174
#if defined(__cpp_explicit_this_parameter) || (defined(__clang__) && __has_extension(cxx_explicit_this_parameter))
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ foreach(EXAMPLE ${EXAMPLES})
)

# Link example with the library.
target_link_libraries(${EXAMPLE} beman.iterator_interface26)
target_link_libraries(${EXAMPLE} beman.iterator_interface)

# Install .
install(
Expand Down
2 changes: 1 addition & 1 deletion examples/sample.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <beman/iterator_interface26/iterator_interface.hpp>
#include <beman/iterator_interface/iterator_interface.hpp>
#include <iostream>

int main() {
Expand Down
2 changes: 1 addition & 1 deletion extern/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(BEMAN_ITERATOR_INTERFACE26_ENABLE_TESTING)
if(BEMAN_ITERATOR_INTERFACE_ENABLE_TESTING)
# Fetch GoogleTest
FetchContent_Declare(
googletest
Expand Down
6 changes: 6 additions & 0 deletions include/beman/iterator_interface/config.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef BEMAN_ITERATOR_INTERFACE_CONFIG_HPP
#define BEMAN_ITERATOR_INTERFACE_CONFIG_HPP

#cmakedefine01 BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS()

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright (C) 2020 T. Zachary Laine
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_CONFIG_HPP
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_CONFIG_HPP

// Included for definition of __cpp_lib_concepts.
#include <iterator>

#if defined(__cpp_lib_concepts) && defined(__cpp_lib_ranges) && \
!defined(BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_DISABLE_CONCEPTS)
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_CONCEPTS 1
#else
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_CONCEPTS 0
#endif

#if defined(__cpp_explicit_this_parameter) && BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_CONCEPTS && \
!defined(BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_DISABLE_DEDUCED_THIS)
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_DEDUCED_THIS 1
#else
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_DEDUCED_THIS 0
#endif

// The inline namespaces v1, v2, and v3 represent C++14, C++20, and C++23 and
// later, respectively. v1 is inline for standards before C++20, and v2 is
// inline for C++20 and later. Note that this only applies to code for which
// multiple vI namespace alternatives exist. For example, some instances of
// the v1 namespace may still be inline, if there is no v2 version of its
// contents.
#if !BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_CONCEPTS && !BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_DEDUCED_THIS
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V1 inline namespace v1
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V2 namespace v2
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V3 namespace v3
#elif BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_CONCEPTS && !BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_DEDUCED_THIS
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V1 namespace v1
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V2 inline namespace v2
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V3 namespace v3
#else
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V1 namespace v1
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V2 namespace v2
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V3 inline namespace v3
#endif

#endif
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
// include/beman/optional26/detail/stl_interfaces/fwd.hpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright (C) 2019 T. Zachary Laine
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_FWD_HPP
#define BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_FWD_HPP
#ifndef BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_FWD_HPP
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_FWD_HPP

#include <beman/iterator_interface26/detail/stl_interfaces/config.hpp>
#include <beman/iterator_interface/detail/stl_interfaces/config.hpp>

#if BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_USE_CONCEPTS
#if BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_USE_CONCEPTS
#include <ranges>
#endif
#if defined(__cpp_lib_three_way_comparison)
#include <compare>
#endif

#ifndef BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_DOXYGEN
#ifndef BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_DOXYGEN

#if defined(_MSC_VER) || defined(__GNUC__) && __GNUC__ < 8
#define BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_NO_HIDDEN_FRIEND_CONSTEXPR
#define BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NO_HIDDEN_FRIEND_CONSTEXPR
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR
#else
#define BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR constexpr
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR constexpr
#endif

#if defined(__GNUC__) && __GNUC__ < 9
#define BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_CONCEPT concept bool
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_CONCEPT concept bool
#else
#define BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_CONCEPT concept
#define BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_CONCEPT concept
#endif

#endif

namespace beman::iterator_interface26::detail {
namespace beman::iterator_interface::detail {
namespace stl_interfaces {

/** An enumeration used to indicate whether the underlying data have a
contiguous or discontiguous layout when instantiating `view_interface`
and `sequence_container_interface`. */
enum class element_layout : bool { discontiguous = false, contiguous = true };

BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_NAMESPACE_V1 {
BEMAN_ITERATOR_INTERFACE_DETAIL_STL_INTERFACES_NAMESPACE_V1 {

namespace v1_dtl {
template <typename... T>
Expand Down Expand Up @@ -83,6 +82,6 @@ BEMAN_ITERATOR_INTERFACE26_DETAIL_STL_INTERFACES_NAMESPACE_V1 {
} // namespace v1_dtl
}
} // namespace stl_interfaces
} // namespace beman::optional26::detail
} // namespace beman::iterator_interface::detail

#endif
Loading
Loading