From a4c22fa02f779c28109e4617ba64ffbd760abcea Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Wed, 22 Jul 2015 22:10:54 +0200 Subject: Change argument of list::set to value --- include/tag_list.h | 6 +++--- src/tag_list.cpp | 2 +- test/nbttest.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/tag_list.h b/include/tag_list.h index f1f5e6dec1..f44f4ba66e 100644 --- a/include/tag_list.h +++ b/include/tag_list.h @@ -96,12 +96,12 @@ public: 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 + * @brief Assigns a value at the given index + * @throw std::bad_cast if the type of the value 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_initializer&& val); + void set(size_t i, value&& val); /** * @brief Appends the tag to the end of the list diff --git a/src/tag_list.cpp b/src/tag_list.cpp index 1d930b4f92..e23f162eb2 100644 --- a/src/tag_list.cpp +++ b/src/tag_list.cpp @@ -79,7 +79,7 @@ const value& tag_list::operator[](size_t i) const return tags[i]; } -void tag_list::set(size_t i, value_initializer&& val) +void tag_list::set(size_t i, value&& val) { if(val.get_type() != el_type_) throw std::bad_cast(); diff --git a/test/nbttest.cpp b/test/nbttest.cpp index ee4b77e321..dc29d1a6ed 100644 --- a/test/nbttest.cpp +++ b/test/nbttest.cpp @@ -277,9 +277,9 @@ void test_tag_list() EXPECT_EXCEPTION(list.at(2), std::out_of_range); EXPECT_EXCEPTION(list.at(-1), std::out_of_range); - list.set(1, tag_string("baz")); + list.set(1, value(tag_string("baz"))); EXPECT_EXCEPTION(list.set(1, value(nullptr)), std::bad_cast); - EXPECT_EXCEPTION(list.set(1, -42), std::bad_cast); + EXPECT_EXCEPTION(list.set(1, value(tag_int(-42))), std::bad_cast); ASSERT(static_cast(list[1]) == "baz"); ASSERT(list.size() == 2); -- cgit 0.0.5-2-1-g0f52