Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
const_iterator_test.cc File Reference

A constant container is read-only: its iterator is Const_Iterator, its accessors hand out references to const, and the members that modify the container are not available through it. More...

#include <gtest/gtest.h>
#include <ah-iterator.H>
#include <ah-zip.H>
#include <ahFunctional.H>
#include <filter_iterator.H>
#include <htlist.H>
#include <tpl_array.H>
#include <tpl_arrayHeap.H>
#include <tpl_arrayQueue.H>
#include <tpl_arrayStack.H>
#include <tpl_dynArray.H>
#include <tpl_dynArrayHeap.H>
#include <tpl_dynBinHeap.H>
#include <tpl_dynDlist.H>
#include <tpl_dynListQueue.H>
#include <tpl_dynListStack.H>
#include <tpl_dynMapTree.H>
#include <tpl_dynSetHash.H>
#include <tpl_dynSetTree.H>
#include <tpl_dynSkipList.H>
#include <tpl_hash.H>
#include <tpl_odhash.H>
#include <tpl_olhash.H>
#include <tpl_memArray.H>
#include <tpl_random_queue.H>
#include <tpl_small_vector.H>
#include <algorithm>
#include <iterator>
#include <type_traits>
#include <utility>
Include dependency graph for const_iterator_test.cc:

Go to the source code of this file.

Functions

 TEST (ConstIterator, the_iterators_that_hand_out_modifiable_references_reject_constant_containers)
 
 TEST (ConstIterator, get_it_depends_on_the_constness_of_the_container)
 
 TEST (ConstIterator, is_as_large_as_the_iterator_that_it_wraps)
 
 TEST (ConstIterator, reads_the_container_like_the_iterator)
 
 TEST (ConstIterator, the_stl_const_iterator_is_read_only_and_random_access_on_arrays)
 
 TEST (ConstIterator, a_constant_dynarray_is_read_without_allocating)
 
 TEST (ConstIterator, the_accessors_of_a_constant_container_hand_out_references_to_const)
 
 TEST (ConstIterator, the_leaks_found_from_a_client_no_longer_compile)
 
 TEST (ConstIterator, the_generic_code_reads_constant_containers)
 

Variables

template<class C >
constexpr bool const_iterator_is_as_large_as_the_iterator
 

Detailed Description

A constant container is read-only: its iterator is Const_Iterator, its accessors hand out references to const, and the members that modify the container are not available through it.

Definition in file const_iterator_test.cc.

Function Documentation

◆ TEST() [1/9]

◆ TEST() [2/9]

TEST ( ConstIterator  ,
get_it_depends_on_the_constness_of_the_container   
)

◆ TEST() [3/9]

TEST ( ConstIterator  ,
is_as_large_as_the_iterator_that_it_wraps   
)

Definition at line 195 of file const_iterator_test.cc.

◆ TEST() [4/9]

◆ TEST() [5/9]

TEST ( ConstIterator  ,
the_accessors_of_a_constant_container_hand_out_references_to_const   
)

◆ TEST() [6/9]

◆ TEST() [7/9]

TEST ( ConstIterator  ,
the_iterators_that_hand_out_modifiable_references_reject_constant_containers   
)

Definition at line 116 of file const_iterator_test.cc.

References Aleph::get_curr().

◆ TEST() [8/9]

TEST ( ConstIterator  ,
the_leaks_found_from_a_client_no_longer_compile   
)

Definition at line 366 of file const_iterator_test.cc.

◆ TEST() [9/9]

TEST ( ConstIterator  ,
the_stl_const_iterator_is_read_only_and_random_access_on_arrays   
)

Variable Documentation

◆ const_iterator_is_as_large_as_the_iterator

template<class C >
constexpr bool const_iterator_is_as_large_as_the_iterator
constexpr
Initial value:
=
sizeof(const_iterator_t<C>) == sizeof(typename C::Iterator)
Read-only view of an Aleph iterator: the iterator of a constant container.

Definition at line 192 of file const_iterator_test.cc.