summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-08-23 15:31:13 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2022-11-17 12:37:10 (GMT)
commit067dcb9efdffab683ce0bd299db7bfb45eaef859 (patch)
tree48e2392757de3a3b1381d97343d935f7c941203b
parent09fdfe5afa2983fb2a0297505f257d03227c9823 (diff)
downloadCMake-067dcb9efdffab683ce0bd299db7bfb45eaef859.zip
CMake-067dcb9efdffab683ce0bd299db7bfb45eaef859.tar.gz
CMake-067dcb9efdffab683ce0bd299db7bfb45eaef859.tar.bz2
cmDocumentationSection: Accept `Iterable` instead of `vector` on add
-rw-r--r--Source/cmDocumentationSection.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h
index 276e520..e1b5454 100644
--- a/Source/cmDocumentationSection.h
+++ b/Source/cmDocumentationSection.h
@@ -4,11 +4,10 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <iterator>
#include <string>
#include <vector>
-#include <cmext/algorithm>
-
#include "cmDocumentationEntry.h"
// Low-level interface for custom documents:
@@ -45,9 +44,12 @@ public:
{
this->Entries.push_back(entry);
}
- void Append(const std::vector<cmDocumentationEntry>& entries)
+
+ template <typename Iterable>
+ void Append(const Iterable& entries)
{
- cm::append(this->Entries, entries);
+ this->Entries.insert(std::end(this->Entries), std::begin(entries),
+ std::end(entries));
}
/** Append an entry to this section using NULL terminated chars */
@@ -56,10 +58,12 @@ public:
/** prepend some documentation to this section */
void Prepend(const char* [][2]);
- void Prepend(const std::vector<cmDocumentationEntry>& entries)
+
+ template <typename Iterable>
+ void Prepend(const Iterable& entries)
{
- this->Entries.insert(this->Entries.begin(), entries.begin(),
- entries.end());
+ this->Entries.insert(std::begin(this->Entries), std::begin(entries),
+ std::end(entries));
}
private: