From 067dcb9efdffab683ce0bd299db7bfb45eaef859 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Tue, 23 Aug 2022 19:31:13 +0400 Subject: cmDocumentationSection: Accept `Iterable` instead of `vector` on add --- Source/cmDocumentationSection.h | 18 +++++++++++------- 1 file 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 #include #include -#include - #include "cmDocumentationEntry.h" // Low-level interface for custom documents: @@ -45,9 +44,12 @@ public: { this->Entries.push_back(entry); } - void Append(const std::vector& entries) + + template + 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& entries) + + template + 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: -- cgit v0.12