hemplateSimple XML template engine |
git clone git://git.dimitrijedobrota.com/hemplate.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |
commit | 98d956c2a2f6c96dff5b0aa4f0c7934ed57c9bb6 |
parent | cc19eac108e768124b0b4953fa9e2bef3dde7bf9 |
author | Dimitrije Dobrota < mail@dimitrijedobrota.com > |
date | Mon, 24 Jun 2024 18:22:46 +0200 |
Add variadic constructor to elementList
M | CMakeLists.txt | | | + - |
M | include/hemplate/element.hpp | | | +++++++ |
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/ CMakeLists.txt b/ CMakeLists.txt
@@ -4,7 +4,7 @@
include(cmake/prelude.cmake)
project(
hemplate
VERSION 0.1.6
VERSION 0.1.7
DESCRIPTION "Simple HTML template engine"
HOMEPAGE_URL "https://git.dimitrijedobrota.com/hemplate.git"
LANGUAGES CXX
diff --git a/ include/hemplate/element.hpp b/ include/hemplate/element.hpp
@@ -20,6 +20,13 @@
public:
elementList(elementList&&) = default;
elementList& operator=(elementList&&) = default;
template<class... Ts>
explicit elementList(Ts&&... args)
{
std::initializer_list<element*> list = {&args...};
for (const auto& elem : list) add(*elem);
}
// explicitly clone all the elements
elementList(const elementList& rhs);
elementList& operator=(const elementList& rhs);