mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 18:29:37 -06:00
cmDocumentationSection: Accept Iterable instead of vector on add
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user