Skip to content

Commit 1004bc3

Browse files
authored
Merge pull request #155 from stlab:sean-parent/updates
Bump dependencies, clean CMake, small headers update
2 parents 4a83677 + 9d02ad0 commit 1004bc3

87 files changed

Lines changed: 290 additions & 660 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.clang-tidy‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
---
2+
Checks: >
3+
clang-diagnostic-*,
4+
clang-analyzer-*,
5+
misc-include-cleaner
6+
CheckOptions:
7+
misc-include-cleaner.MissingIncludes: false
28
SystemHeaders: false
3-
HeaderFilterRegex: '^(?!.*(boost|_deps)).*$'
9+
HeaderFilterRegex: "^(?!.*(boost|_deps)).*$"
410
FormatStyle: none

‎CMakeLists.txt‎

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ cmake_minimum_required(VERSION 3.29)
22
include(cmake/CPM.cmake)
33

44
# Add cpp-library for set version
5+
# [DEPENDENCY] https://github.com/stlab/cpp-library
56
# CPMAddPackage(
67
# NAME cpp-library
78
# SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cpp-library"
89
# )
9-
CPMAddPackage("gh:stlab/cpp-library@5.2.0")
10+
CPMAddPackage("gh:stlab/cpp-library@5.4.1")
1011
include(${cpp-library_SOURCE_DIR}/cpp-library.cmake)
1112

1213
project(adobe-source-libraries CXX)
@@ -18,7 +19,7 @@ cpp_library_set_version()
1819
include(FindGit)
1920
include(CMakeParseArguments)
2021

21-
if (PROJECT_IS_TOP_LEVEL)
22+
if(PROJECT_IS_TOP_LEVEL)
2223
include(CTest)
2324
endif()
2425

@@ -30,7 +31,7 @@ endif()
3031
# Dependencies
3132

3233
# https://github.com/stlab/copy-on-write/releases
33-
CPMAddPackage("gh:stlab/copy-on-write@1.1.0")
34+
CPMAddPackage("gh:stlab/copy-on-write@1.1.1")
3435

3536
# https://github.com/stlab/enum-ops/releases
3637
CPMAddPackage(gh:stlab/enum-ops@1.2.0)
@@ -50,9 +51,9 @@ set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
5051
# https://github.com/boostorg/boost/releases
5152
CPMAddPackage(
5253
NAME Boost
53-
VERSION 1.90.0
54-
URL https://github.com/boostorg/boost/releases/download/boost-1.90.0/boost-1.90.0-cmake.7z
55-
URL_HASH SHA256=218e74c4aa362a994b7b7a23b2920f455a00205c656405fcf262cf60b8871921
54+
VERSION 1.91.0-1
55+
URL https://github.com/boostorg/boost/releases/download/boost-1.91.0-1/boost-1.91.0-1-cmake.7z
56+
URL_HASH SHA256=29c7d4f4ac36ad853b6765d03571ea60d90286775df026b4efd9f3281131972b
5657
OPTIONS
5758
"BOOST_ENABLE_CMAKE ON"
5859
"CMAKE_CXX_CLANG_TIDY ;"
@@ -85,45 +86,41 @@ option(BUILD_DOCS "Build documentation" OFF)
8586

8687
if(BUILD_DOCS)
8788
find_package(Doxygen REQUIRED)
88-
89-
if(DOXYGEN_FOUND)
90-
# Download doxygen-awesome-css theme via CPM
91-
# https://github.com/jothepro/doxygen-awesome-css
92-
CPMAddPackage(
93-
URI gh:jothepro/doxygen-awesome-css@2.4.1
94-
DOWNLOAD_ONLY YES
95-
)
96-
set(AWESOME_CSS_DIR ${doxygen-awesome-css_SOURCE_DIR})
97-
98-
# Configure Doxyfile
99-
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/documentation/doxyfile.in)
100-
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
101-
102-
# Set variables for Doxyfile template
103-
set(PROJECT_NAME "Adobe Source Libraries")
104-
set(PROJECT_BRIEF "A collection of C++ libraries.")
105-
set(PROJECT_VERSION ${PROJECT_VERSION})
106-
set(INPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
107-
set(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
108-
set(AWESOME_CSS_PATH "${AWESOME_CSS_DIR}")
109-
set(CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
110-
111-
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
112-
113-
# Add custom target for documentation
114-
add_custom_target(docs
115-
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
116-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
117-
COMMENT "Generating API documentation with Doxygen"
118-
VERBATIM
119-
)
120-
121-
# Ensure the output directory exists
122-
file(MAKE_DIRECTORY ${OUTPUT_DIR})
123-
124-
message(STATUS "Documentation target 'docs' configured")
125-
message(STATUS "Run 'cmake --build . --target docs' to generate documentation")
126-
else()
127-
message(WARNING "Doxygen not found. Documentation will not be built.")
128-
endif()
129-
endif()
89+
90+
# Download doxygen-awesome-css theme via CPM
91+
# https://github.com/jothepro/doxygen-awesome-css
92+
CPMAddPackage(
93+
URI gh:jothepro/doxygen-awesome-css@2.4.2
94+
DOWNLOAD_ONLY YES
95+
)
96+
set(AWESOME_CSS_DIR ${doxygen-awesome-css_SOURCE_DIR})
97+
98+
# Configure Doxyfile
99+
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/documentation/doxyfile.in)
100+
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
101+
102+
# Set variables for Doxyfile template
103+
set(PROJECT_NAME "Adobe Source Libraries")
104+
set(PROJECT_BRIEF "A collection of C++ libraries.")
105+
set(PROJECT_VERSION ${PROJECT_VERSION})
106+
set(INPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
107+
set(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
108+
set(AWESOME_CSS_PATH "${AWESOME_CSS_DIR}")
109+
set(CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
110+
111+
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
112+
113+
# Add custom target for documentation
114+
add_custom_target(docs
115+
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
116+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
117+
COMMENT "Generating API documentation with Doxygen"
118+
VERBATIM
119+
)
120+
121+
# Ensure the output directory exists
122+
file(MAKE_DIRECTORY ${OUTPUT_DIR})
123+
124+
message(STATUS "Documentation target 'docs' configured")
125+
message(STATUS "Run 'cmake --build . --target docs' to generate documentation")
126+
endif()

‎adobe/algorithm/equal_range.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ equal_range(I& r, const T& x) {
233233
template <typename I, // I models ForwardRange
234234
typename T> // T == result_type(P)
235235
inline std::pair<typename boost::range_const_iterator<I>::type,
236-
typename boost::range_const_iterator<I>::type>
237-
equal_range(const I& r, const T& x) {
236+
typename boost::range_const_iterator<I>::type> equal_range(const I& r,
237+
const T& x) {
238238
return std::equal_range(boost::begin(r), boost::end(r), x);
239239
}
240240

‎adobe/algorithm/exists.hpp‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
#ifndef ADOBE_ALGORITHM_EXISTS_HPP
99
#define ADOBE_ALGORITHM_EXISTS_HPP
1010

11-
#include <adobe/config.hpp>
12-
13-
#include <algorithm>
14-
1511
/**************************************************************************************************/
1612

1713
namespace adobe {

‎adobe/algorithm/fill.hpp‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#ifndef ADOBE_ALGORITHM_FILL_HPP
99
#define ADOBE_ALGORITHM_FILL_HPP
1010

11-
#include <adobe/config.hpp>
12-
1311
#include <boost/range/begin.hpp>
1412
#include <boost/range/end.hpp>
1513

‎adobe/algorithm/filter.hpp‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
#ifndef ADOBE_ALGORITHM_FILTER_HPP
99
#define ADOBE_ALGORITHM_FILTER_HPP
1010

11-
#include <adobe/config.hpp>
12-
1311
#include <boost/range/begin.hpp>
1412
#include <boost/range/end.hpp>
1513

16-
#include <algorithm>
1714
#include <functional>
1815

1916
/**************************************************************************************************/
@@ -25,7 +22,9 @@ namespace adobe {
2522
\defgroup filter filter
2623
\ingroup mutating_algorithm
2724
28-
Filter is similar to \c std::tranform. The \c op function is passed an instance of an [output_iterator](https://www.boost.org/sgi/stl/output_iterator.html) and can generate more than (or fewer than) a single result.
25+
Filter is similar to \c std::transform. The \c op function is passed an instance of an
26+
[output_iterator](https://www.boost.org/sgi/stl/output_iterator.html) and can generate more than (or
27+
fewer than) a single result.
2928
3029
The \c op function is called once for each item in the range <code>[first, last)</code>. The \c
3130
result parameter is passed into the first call to \c op, the result of \c op is passed to subsequent

‎adobe/algorithm/find.hpp‎

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace adobe {
3232
- [STL documentation for find_if](https://www.boost.org/sgi/stl/find_if.html)
3333
- [STL documentation for find_end](https://www.boost.org/sgi/stl/find_end.html)
3434
- [STL documentation for find_first_of](https://www.boost.org/sgi/stl/find_first_of.html)
35+
- find_first_of is a quadratic algorithm. Use find_if with is_member instead.
3536
- [STL documentation for adjacent_find](https://www.boost.org/sgi/stl/adjacent_find.html)
3637
*/
3738

@@ -276,80 +277,6 @@ find_end(const ForwardRange1& range1, const ForwardRange2& range2, BinaryPredica
276277
boost::end(range2), comp);
277278
}
278279

279-
#if 0
280-
281-
// find_first_of is a bad algorithm. Use find_first_of_set until we provide a better predicate.
282-
283-
/*!
284-
\ingroup find
285-
286-
\brief find implementation
287-
*/
288-
template <class InputRange, class ForwardRange>
289-
inline typename boost::range_iterator<InputRange>::type
290-
find_first_of(InputRange& range1, const ForwardRange& range2)
291-
{
292-
return std::find_first_of(boost::begin(range1), boost::end(range1),
293-
boost::begin(range2), boost::end(range2));
294-
}
295-
296-
/*!
297-
\ingroup find
298-
299-
\brief find implementation
300-
*/
301-
template <class InputRange, class ForwardRange>
302-
inline typename boost::range_const_iterator<InputRange>::type
303-
find_first_of(const InputRange& range1, const ForwardRange& range2)
304-
{
305-
return std::find_first_of(boost::begin(range1), boost::end(range1),
306-
boost::begin(range2), boost::end(range2));
307-
}
308-
309-
/*!
310-
\ingroup find
311-
312-
\brief find implementation
313-
*/
314-
template <class InputIterator, class ForwardIterator, class BinaryPredicate>
315-
inline InputIterator find_first_of(InputIterator first1, InputIterator last1,
316-
ForwardIterator first2, ForwardIterator last2,
317-
BinaryPredicate comp)
318-
319-
{
320-
return std::find_first_of(first1, last1, first2, last2, std::bind(comp, std::placeholders::_1, std::placeholders::_2));
321-
}
322-
323-
/*!
324-
\ingroup find
325-
326-
\brief find implementation
327-
*/
328-
template <class InputRange, class ForwardRange, class BinaryPredicate>
329-
inline typename boost::range_iterator<InputRange>::type
330-
find_first_of(InputRange& range1, const ForwardRange& range2, BinaryPredicate comp)
331-
{
332-
return adobe::find_first_of(boost::begin(range1), boost::end(range1),
333-
boost::begin(range2), boost::end(range2),
334-
comp);
335-
}
336-
337-
/*!
338-
\ingroup find
339-
340-
\brief find implementation
341-
*/
342-
template <class InputRange, class ForwardRange, class BinaryPredicate>
343-
inline typename boost::range_const_iterator<InputRange>::type
344-
find_first_of(const InputRange& range1, const ForwardRange& range2, BinaryPredicate comp)
345-
{
346-
return adobe::find_first_of(boost::begin(range1), boost::end(range1),
347-
boost::begin(range2), boost::end(range2),
348-
comp);
349-
}
350-
351-
#endif
352-
353280
/*!
354281
\ingroup find
355282

‎adobe/algorithm/iota.hpp‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include <boost/range/begin.hpp>
1616
#include <boost/range/end.hpp>
1717

18-
#include <algorithm>
19-
2018
/**************************************************************************************************/
2119

2220
namespace adobe {

‎adobe/algorithm/reduce.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
#include <adobe/config.hpp>
1212

13+
#include <adobe/algorithm/find.hpp>
1314
#include <adobe/algorithm/identity_element.hpp>
1415
#include <adobe/algorithm/other_of.hpp>
1516
#include <adobe/functional.hpp>
1617
#include <adobe/iterator/type_functions.hpp>
1718

18-
#include <algorithm>
19-
#include <functional>
19+
#include <iterator>
2020
#include <vector>
2121

2222
/**************************************************************************************************/

‎adobe/algorithm/sorted.hpp‎

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <boost/range/begin.hpp>
1616
#include <boost/range/end.hpp>
1717

18+
#include <adobe/functional/operator.hpp>
19+
1820
/**************************************************************************************************/
1921

2022
namespace adobe {
@@ -34,10 +36,7 @@ template <typename I, // I models InputIterator
3436
I sorted(I f, I l, O o) {
3537

3638
f = std::adjacent_find(
37-
f, l,
38-
[&o](const auto& first, const auto& next) {
39-
return !std::invoke(o, first, next);
40-
});
39+
f, l, [&o](const auto& first, const auto& next) { return !std::invoke(o, first, next); });
4140

4241
if (f != l)
4342
++f;
@@ -63,11 +62,9 @@ template <typename I, // I models InputIterator
6362
typename O>
6463
// O models StrictWeakOrdering on value_type(I)
6564
inline bool is_sorted(I f, I l, O o) {
66-
return std::adjacent_find(
67-
f, l,
68-
[&o](const auto& first, const auto& next) {
69-
return !std::invoke(o, first, next);
70-
}) == l;
65+
return std::adjacent_find(f, l, [&o](const auto& first, const auto& next) {
66+
return !std::invoke(o, first, next);
67+
}) == l;
7168
}
7269

7370
/**************************************************************************************************/
@@ -90,16 +87,9 @@ template <typename I, // I models ForwardIterator
9087
typename P>
9188
// P models UnaryFunction(value_type(I)) -> T
9289
inline bool is_sorted(I f, I l, C c, P p) {
93-
return std::adjacent_find(
94-
f, l,
95-
[&c, &p](const auto& first, const auto& next) {
96-
return !std::invoke(
97-
c,
98-
std::invoke(p, first),
99-
std::invoke(p, next)
100-
);
101-
}
102-
) == l;
90+
return std::adjacent_find(f, l, [&c, &p](const auto& first, const auto& next) {
91+
return !std::invoke(c, std::invoke(p, first), std::invoke(p, next));
92+
}) == l;
10393
}
10494

10595
/**************************************************************************************************/

0 commit comments

Comments
 (0)