41# include <gtest/gtest.h>
45using namespace testing;
59static_assert(
noexcept(std::declval<Snodenc<int> &>().get_first()));
88 ASSERT_EQ(ptr->
to_data<
int>(), 10);
95 ASSERT_EQ(ptr->
to_data<
int>(), 10);
101 ASSERT_EQ(list.get_next()->get_data(), 1);
107 EXPECT_EQ(ptr->get_data(), i++);
110 auto ptr = list.remove_first();
111 EXPECT_EQ(ptr->get_data(), 1);
112 EXPECT_TRUE(ptr->is_empty());
114 EXPECT_EQ(list.get_next()->get_data(), 1);
129 EXPECT_EQ(a.get_first(),
nullptr);
WeightedDigraph::Node Node
void insert(Dlink *node) noexcept
Insert node after this.
Dlink * remove_next() noexcept
Remove the item that is after this
Link of a single linked list non-circular and without header node.
T & to_data() noexcept
Return the item of the Snodenc<T> that this is.
constexpr bool is_empty() const noexcept
Return true if this is empty.
Snodenc< T > * to_snodenc() noexcept
Convert this to a Snodenc<T>.
void insert(Slinknc *p) noexcept
insert(p) inserts the node pointed by p after this.
Snodenc *& get_first() noexcept
Return the first node of the list whose header is this.
Snodenc *& get_next() noexcept
Return the node following to this
T & get_data() noexcept
Return a modifiable reference to the data.
Snodenc * remove_first() noexcept
See remove_next().
Singly linked list implementations with head-tail access.
Main namespace for Aleph-w library functions.
TEST_F(List_of_5_nodes, Basic_operations)