From 63460f29957ed2e28ee35ee8a92432fe446e0936 Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Sun, 12 Jul 2015 12:54:09 +0200 Subject: Create tag_list::set method --- include/tag_list.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/tag_list.h b/include/tag_list.h index b13da3c5a9..d0b80ebb01 100644 --- a/include/tag_list.h +++ b/include/tag_list.h @@ -52,7 +52,7 @@ public: * * Returns a value to the tag at the specified index, or throws an * exception if it is out of range. - * @throw std::out_of_range if given key does not exist + * @throw std::out_of_range if the index is out of range */ value& at(size_t i); const value& at(size_t i) const; @@ -66,6 +66,14 @@ public: value& operator[](size_t i); const value& operator[](size_t i) const; + /** + * @brief Assigns a tag at the given index + * @throw std::bad_cast if the type of the tag does not match the list's + * content type + * @throw std::out_of_range if the index is out of range + */ + void set(size_t i, value&& val); + /** * @brief Appends the tag to the end of the list * @throw std::bad_cast if the type of the tag does not match the list's @@ -106,7 +114,7 @@ public: private: std::vector tags; - tag_type el_type; + tag_type el_type_; }; } -- cgit 0.0.5-2-1-g0f52