aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests/optional/assignment
diff options
context:
space:
mode:
authorLancelot Six <lancelot.six@amd.com>2023-10-13 09:55:19 +0000
committerLancelot Six <lancelot.six@amd.com>2023-11-21 11:52:35 +0000
commit42742fc5817a8f2e47c711880501073a9ad86cfc (patch)
treea8a3ceb7ef74871b4226955eff34fc9585ba54c3 /gdb/unittests/optional/assignment
parent6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b (diff)
downloadbinutils-42742fc5817a8f2e47c711880501073a9ad86cfc.zip
binutils-42742fc5817a8f2e47c711880501073a9ad86cfc.tar.gz
binutils-42742fc5817a8f2e47c711880501073a9ad86cfc.tar.bz2
gdbsupport: remove gdb::optional
The previous patch migrated all the uses of gdb::optional to use std::optional instead, so gdb::optional can be removed entirely as well as the self-tests which came with it. Change-Id: I96ecd67b850b01be10ef00eb85a78ac647d5adc7 Approved-By: Tom Tromey <tom@tromey.com> Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/unittests/optional/assignment')
-rw-r--r--gdb/unittests/optional/assignment/1.cc196
-rw-r--r--gdb/unittests/optional/assignment/2.cc194
-rw-r--r--gdb/unittests/optional/assignment/3.cc157
-rw-r--r--gdb/unittests/optional/assignment/4.cc157
-rw-r--r--gdb/unittests/optional/assignment/5.cc81
-rw-r--r--gdb/unittests/optional/assignment/6.cc91
-rw-r--r--gdb/unittests/optional/assignment/7.cc30
7 files changed, 0 insertions, 906 deletions
diff --git a/gdb/unittests/optional/assignment/1.cc b/gdb/unittests/optional/assignment/1.cc
deleted file mode 100644
index 6a68f7d..0000000
--- a/gdb/unittests/optional/assignment/1.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-// Copyright (C) 2013-2023 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-namespace assign_1 {
-
-struct exception {};
-
-static int counter = 0;
-
-struct mixin_counter
-{
- mixin_counter() { ++counter; }
- mixin_counter(mixin_counter const&) { ++counter; }
- ~mixin_counter() { --counter; }
-};
-
-struct value_type : private mixin_counter
-{
- enum state_type
- {
- zero,
- moved_from,
- throwing_construction,
- throwing_copy,
- throwing_copy_assignment,
- throwing_move,
- throwing_move_assignment,
- threw,
- };
-
- value_type() = default;
-
- explicit value_type(state_type state_)
- : state(state_)
- {
- throw_if(throwing_construction);
- }
-
- value_type(value_type const& other)
- : state(other.state)
- {
- throw_if(throwing_copy);
- }
-
- value_type&
- operator=(value_type const& other)
- {
- state = other.state;
- throw_if(throwing_copy_assignment);
- return *this;
- }
-
- value_type(value_type&& other)
- : state(other.state)
- {
- other.state = moved_from;
- throw_if(throwing_move);
- }
-
- value_type&
- operator=(value_type&& other)
- {
- state = other.state;
- other.state = moved_from;
- throw_if(throwing_move_assignment);
- return *this;
- }
-
- void throw_if(state_type match)
- {
- if(state == match)
- {
- state = threw;
- throw exception {};
- }
- }
-
- state_type state = zero;
-};
-
-static void
-test ()
-{
- using O = gdb::optional<value_type>;
- using S = value_type::state_type;
- auto const make = [](S s = S::zero) { return O { gdb::in_place, s }; };
-
- enum outcome_type { nothrow, caught, bad_catch };
-
- // Check copy/move assignment for disengaged optional
-
- // From disengaged optional
- {
- O o;
- VERIFY( !o );
- O p;
- o = p;
- VERIFY( !o );
- VERIFY( !p );
- }
-
- {
- O o;
- VERIFY( !o );
- O p;
- o = std::move(p);
- VERIFY( !o );
- VERIFY( !p );
- }
-
-#ifndef GDB_OPTIONAL
- {
- O o;
- VERIFY( !o );
- o = {};
- VERIFY( !o );
- }
-#endif
-
- // From engaged optional
- {
- O o;
- VERIFY( !o );
- O p = make(S::throwing_copy_assignment);
- o = p;
- VERIFY( o && o->state == S::throwing_copy_assignment );
- VERIFY( p && p->state == S::throwing_copy_assignment );
- }
-
- {
- O o;
- VERIFY( !o );
- O p = make(S::throwing_move_assignment);
- o = std::move(p);
- VERIFY( o && o->state == S::throwing_move_assignment );
- VERIFY( p && p->state == S::moved_from );
- }
-
- {
- outcome_type outcome {};
- O o;
- VERIFY( !o );
- O p = make(S::throwing_copy);
-
- try
- {
- o = p;
- }
- catch(exception const&)
- { outcome = caught; }
- catch(...)
- { outcome = bad_catch; }
-
- VERIFY( outcome == caught );
- VERIFY( !o );
- VERIFY( p && p->state == S::throwing_copy );
- }
-
- {
- outcome_type outcome {};
- O o;
- VERIFY( !o );
- O p = make(S::throwing_move);
-
- try
- {
- o = std::move(p);
- }
- catch(exception const&)
- { outcome = caught; }
- catch(...)
- { outcome = bad_catch; }
-
- VERIFY( outcome == caught );
- VERIFY( !o );
- VERIFY( p && p->state == S::moved_from );
- }
-
- VERIFY( counter == 0 );
-}
-
-} // namespace assign_1
diff --git a/gdb/unittests/optional/assignment/2.cc b/gdb/unittests/optional/assignment/2.cc
deleted file mode 100644
index 2e63a49..0000000
--- a/gdb/unittests/optional/assignment/2.cc
+++ /dev/null
@@ -1,194 +0,0 @@
-// Copyright (C) 2013-2023 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-namespace assign_2 {
-
-struct exception {};
-
-static int counter = 0;
-
-struct mixin_counter
-{
- mixin_counter() { ++counter; }
- mixin_counter(mixin_counter const&) { ++counter; }
- ~mixin_counter() { --counter; }
-};
-
-struct value_type : private mixin_counter
-{
- enum state_type
- {
- zero,
- moved_from,
- throwing_construction,
- throwing_copy,
- throwing_copy_assignment,
- throwing_move,
- throwing_move_assignment,
- threw,
- };
-
- value_type() = default;
-
- explicit value_type(state_type state_)
- : state(state_)
- {
- throw_if(throwing_construction);
- }
-
- value_type(value_type const& other)
- : state(other.state)
- {
- throw_if(throwing_copy);
- }
-
- value_type&
- operator=(value_type const& other)
- {
- state = other.state;
- throw_if(throwing_copy_assignment);
- return *this;
- }
-
- value_type(value_type&& other)
- : state(other.state)
- {
- other.state = moved_from;
- throw_if(throwing_move);
- }
-
- value_type&
- operator=(value_type&& other)
- {
- state = other.state;
- other.state = moved_from;
- throw_if(throwing_move_assignment);
- return *this;
- }
-
- void throw_if(state_type match)
- {
- if(state == match)
- {
- state = threw;
- throw exception {};
- }
- }
-
- state_type state = zero;
-};
-
-static void
-test ()
-{
- using O = gdb::optional<value_type>;
- using S = value_type::state_type;
- auto const make = [](S s = S::zero) { return O { gdb::in_place, s }; };
-
- enum outcome_type { nothrow, caught, bad_catch };
-
- // Check copy/move assignment for engaged optional
-
- // From disengaged optional
- {
- O o = make(S::zero);
- VERIFY( o );
- O p;
- o = p;
- VERIFY( !o );
- VERIFY( !p );
- }
-
- {
- O o = make(S::zero);
- VERIFY( o );
- O p;
- o = std::move(p);
- VERIFY( !o );
- VERIFY( !p );
- }
-
-#ifndef GDB_OPTIONAL
- {
- O o = make(S::zero);
- VERIFY( o );
- o = {};
- VERIFY( !o );
- }
-#endif
-
- // From engaged optional
- {
- O o = make(S::zero);
- VERIFY( o );
- O p = make(S::throwing_copy);
- o = p;
- VERIFY( o && o->state == S::throwing_copy);
- VERIFY( p && p->state == S::throwing_copy);
- }
-
- {
- O o = make(S::zero);
- VERIFY( o );
- O p = make(S::throwing_move);
- o = std::move(p);
- VERIFY( o && o->state == S::throwing_move);
- VERIFY( p && p->state == S::moved_from);
- }
-
- {
- ATTRIBUTE_UNUSED outcome_type outcome {};
- O o = make(S::zero);
- VERIFY( o );
- O p = make(S::throwing_copy_assignment);
-
- try
- {
- o = p;
- }
- catch(exception const&)
- { outcome = caught; }
- catch(...)
- { outcome = bad_catch; }
-
- VERIFY( o && o->state == S::threw);
- VERIFY( p && p->state == S::throwing_copy_assignment);
- }
-
- {
- ATTRIBUTE_UNUSED outcome_type outcome {};
- O o = make(S::zero);
- VERIFY( o );
- O p = make(S::throwing_move_assignment);
-
- try
- {
- o = std::move(p);
- }
- catch(exception const&)
- { outcome = caught; }
- catch(...)
- { outcome = bad_catch; }
-
- VERIFY( o && o->state == S::threw);
- VERIFY( p && p->state == S::moved_from);
- }
-
- VERIFY( counter == 0 );
-}
-
-} // namespace assign_2
diff --git a/gdb/unittests/optional/assignment/3.cc b/gdb/unittests/optional/assignment/3.cc
deleted file mode 100644
index a1d0934..0000000
--- a/gdb/unittests/optional/assignment/3.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright (C) 2013-2023 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-namespace assign_3 {
-
-struct exception {};
-
-static int counter = 0;
-
-struct mixin_counter
-{
- mixin_counter() { ++counter; }
- mixin_counter(mixin_counter const&) { ++counter; }
- ~mixin_counter() { --counter; }
-};
-
-struct value_type : private mixin_counter
-{
- enum state_type
- {
- zero,
- moved_from,
- throwing_construction,
- throwing_copy,
- throwing_copy_assignment,
- throwing_move,
- throwing_move_assignment,
- threw,
- };
-
- value_type() = default;
-
- explicit value_type(state_type state_)
- : state(state_)
- {
- throw_if(throwing_construction);
- }
-
- value_type(value_type const& other)
- : state(other.state)
- {
- throw_if(throwing_copy);
- }
-
- value_type&
- operator=(value_type const& other)
- {
- state = other.state;
- throw_if(throwing_copy_assignment);
- return *this;
- }
-
- value_type(value_type&& other)
- : state(other.state)
- {
- other.state = moved_from;
- throw_if(throwing_move);
- }
-
- value_type&
- operator=(value_type&& other)
- {
- state = other.state;
- other.state = moved_from;
- throw_if(throwing_move_assignment);
- return *this;
- }
-
- void throw_if(state_type match)
- {
- if(state == match)
- {
- state = threw;
- throw exception {};
- }
- }
-
- state_type state = zero;
-};
-
-static void
-test ()
-{
- using O = gdb::optional<value_type>;
- using S = value_type::state_type;
- auto const make = [](S s = S::zero) { return value_type { s }; };
-
- enum outcome_type { nothrow, caught, bad_catch };
-
- // Check value assignment for disengaged optional
-
- {
- O o;
- value_type v = make(S::throwing_copy_assignment);
- o = v;
- VERIFY( o && o->state == S::throwing_copy_assignment );
- }
-
- {
- O o;
- value_type v = make(S::throwing_move_assignment);
- o = std::move(v);
- VERIFY( o && o->state == S::throwing_move_assignment );
- }
-
- {
- ATTRIBUTE_UNUSED outcome_type outcome {};
- O o;
- value_type v = make(S::throwing_copy);
-
- try
- {
- o = v;
- }
- catch(exception const&)
- { outcome = caught; }
- catch(...)
- { outcome = bad_catch; }
-
- VERIFY( !o );
- }
-
- {
- ATTRIBUTE_UNUSED outcome_type outcome {};
- O o;
- value_type v = make(S::throwing_move);
-
- try
- {
- o = std::move(v);
- }
- catch(exception const&)
- { outcome = caught; }
- catch(...)
- { outcome = bad_catch; }
-
- VERIFY( !o );
- }
-
- VERIFY( counter == 0 );
-}
-
-} // namespace assign_3
diff --git a/gdb/unittests/optional/assignment/4.cc b/gdb/unittests/optional/assignment/4.cc
deleted file mode 100644
index 2ad5978..0000000
--- a/gdb/unittests/optional/assignment/4.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright (C) 2013-2023 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-namespace assign_4 {
-
-struct exception {};
-
-static int counter = 0;
-
-struct mixin_counter
-{
- mixin_counter() { ++counter; }
- mixin_counter(mixin_counter const&) { ++counter; }
- ~mixin_counter() { --counter; }
-};
-
-struct value_type : private mixin_counter
-{
- enum state_type
- {
- zero,
- moved_from,
- throwing_construction,
- throwing_copy,
- throwing_copy_assignment,
- throwing_move,
- throwing_move_assignment,
- threw,
- };
-
- value_type() = default;
-
- explicit value_type(state_type state_)
- : state(state_)
- {
- throw_if(throwing_construction);
- }
-
- value_type(value_type const& other)
- : state(other.state)
- {
- throw_if(throwing_copy);
- }
-
- value_type&
- operator=(value_type const& other)
- {
- state = other.state;
- throw_if(throwing_copy_assignment);
- return *this;
- }
-
- value_type(value_type&& other)
- : state(other.state)
- {
- other.state = moved_from;
- throw_if(throwing_move);
- }
-
- value_type&
- operator=(value_type&& other)
- {
- state = other.state;
- other.state = moved_from;
- throw_if(throwing_move_assignment);
- return *this;
- }
-
- void throw_if(state_type match)
- {
- if(state == match)
- {
- state = threw;
- throw exception {};
- }
- }
-
- state_type state = zero;
-};
-
-static void
-test ()
-{
- using O = gdb::optional<value_type>;
- using S = value_type::state_type;
- auto const make = [](S s = S::zero) { return value_type { s }; };
-
- enum outcome_type { nothrow, caught, bad_catch };
-
- // Check value assignment for engaged optional
-
- {
- O o = make();
- value_type v = make(S::throwing_copy);
- o = v;
- VERIFY( o && o->state == S::throwing_copy);
- }
-
- {
- O o = make();
- value_type v = make(S::throwing_move);
- o = std::move(v);
- VERIFY( o && o->state == S::throwing_move);
- }
-
- {
- ATTRIBUTE_UNUSED outcome_type outcome {};
- O o = make();
- value_type v = make(S::throwing_copy_assignment);
-
- try
- {
- o = v;
- }
- catch(exception const&)
- { outcome = caught; }
- catch(...)
- { outcome = bad_catch; }
-
- VERIFY( o && o->state == S::threw );
- }
-
- {
- ATTRIBUTE_UNUSED outcome_type outcome {};
- O o = make();
- value_type v = make(S::throwing_move_assignment);
-
- try
- {
- o = std::move(v);
- }
- catch(exception const&)
- { outcome = caught; }
- catch(...)
- { outcome = bad_catch; }
-
- VERIFY( o && o->state == S::threw );
- }
-
- VERIFY( counter == 0 );
-}
-
-} // namespace assign_4
diff --git a/gdb/unittests/optional/assignment/5.cc b/gdb/unittests/optional/assignment/5.cc
deleted file mode 100644
index 85016a2..0000000
--- a/gdb/unittests/optional/assignment/5.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (C) 2013-2023 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-namespace assign_5 {
-
-static int counter = 0;
-
-struct mixin_counter
-{
- mixin_counter() { ++counter; }
- mixin_counter(mixin_counter const&) { ++counter; }
- ~mixin_counter() { --counter; }
-};
-
-struct value_type : private mixin_counter { };
-
-static void
-test ()
-{
- using O = gdb::optional<value_type>;
-
- // Check std::nullopt_t and 'default' (= {}) assignment
-
-#ifndef GDB_OPTIONAL
- {
- O o;
- o = std::nullopt;
- VERIFY( !o );
- }
-#endif
-
-#ifndef GDB_OPTIONAL
- {
- O o { gdb::in_place };
- o = std::nullopt;
- VERIFY( !o );
- }
-#endif
-
-#ifndef GDB_OPTIONAL
- {
- O o;
- o = {};
- VERIFY( !o );
- }
-#endif
-
-#ifndef GDB_OPTIONAL
- {
- O o { gdb::in_place };
- o = {};
- VERIFY( !o );
- }
-#endif
- {
- gdb::optional<std::vector<int>> ovi{{1, 2, 3}};
- VERIFY(ovi->size() == 3);
- VERIFY((*ovi)[0] == 1 && (*ovi)[1] == 2 && (*ovi)[2] == 3);
- ovi = {4, 5, 6, 7};
- VERIFY(ovi->size() == 4);
- VERIFY((*ovi)[0] == 4 && (*ovi)[1] == 5 &&
- (*ovi)[2] == 6 && (*ovi)[3] == 7);
- }
- VERIFY( counter == 0 );
-}
-
-} // namespace assign_5
diff --git a/gdb/unittests/optional/assignment/6.cc b/gdb/unittests/optional/assignment/6.cc
deleted file mode 100644
index d0ea95f..0000000
--- a/gdb/unittests/optional/assignment/6.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (C) 2013-2023 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-namespace assign_6 {
-
-static int counter = 0;
-
-struct mixin_counter
-{
- mixin_counter() { ++counter; }
- mixin_counter(mixin_counter const&) { ++counter; }
- ~mixin_counter() { --counter; }
-};
-
-struct value_type : private mixin_counter
-{
- value_type() = default;
- value_type(int) : state(1) { }
- value_type(std::initializer_list<char>, const char*) : state(2) { }
- int state = 0;
-};
-
-static void
-test ()
-{
- using O = gdb::optional<value_type>;
-
- // Check emplace
-
- {
- O o;
- o.emplace();
- VERIFY( o && o->state == 0 );
- }
- {
- O o { gdb::in_place, 0 };
- o.emplace();
- VERIFY( o && o->state == 0 );
- }
-
- {
- O o;
- o.emplace(0);
- VERIFY( o && o->state == 1 );
- }
- {
- O o { gdb::in_place };
- o.emplace(0);
- VERIFY( o && o->state == 1 );
- }
-
-#ifndef GDB_OPTIONAL
- {
- O o;
- o.emplace({ 'a' }, "");
- VERIFY( o && o->state == 2 );
- }
- {
- O o { gdb::in_place };
- o.emplace({ 'a' }, "");
- VERIFY( o && o->state == 2 );
- }
-#endif
- {
- O o;
- VERIFY(&o.emplace(0) == &*o);
-#ifndef GDB_OPTIONAL
- VERIFY(&o.emplace({ 'a' }, "") == &*o);
-#endif
- }
-
- static_assert( !std::is_constructible<O, std::initializer_list<int>, int>(), "" );
-
- VERIFY( counter == 0 );
-}
-
-} // namespace assign_6
diff --git a/gdb/unittests/optional/assignment/7.cc b/gdb/unittests/optional/assignment/7.cc
deleted file mode 100644
index a9bd181..0000000
--- a/gdb/unittests/optional/assignment/7.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (C) 2016-2023 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-namespace assign_7 {
-
-static void
-test ()
-{
- gdb::optional<int> o{666};
- VERIFY(o && *o == 666);
- o.reset();
- VERIFY(!o);
- static_assert(noexcept(std::declval<gdb::optional<int>>().reset()), "");
-}
-
-} // namespace assign_7