P4C
The P4 Compiler
Loading...
Searching...
No Matches
assoc::hash_set< T, Hash, Equal, Allocator > Class Template Reference

#include <assoc.h>

Inheritance diagram for assoc::hash_set< T, Hash, Equal, Allocator >:
[legend]

Public Member Functions

void swap (hash_set &other) noexcept
 
const ABase & unstable_iterable () const
 

Detailed Description

template<typename T, typename Hash = boost::hash<T>, typename Equal = std::equal_to<T>, typename Allocator = std::allocator<T>>
class assoc::hash_set< T, Hash, Equal, Allocator >

Set container implemented as hashtable. Provides average constant time lookup. Member functions used for iteration (begin) are intentionaly not exposed to avoid accidental nondeterministic behavior of the compiler.

See also
namespace assoc

Member Function Documentation

◆ unstable_iterable()

template<typename T , typename Hash = boost::hash<T>, typename Equal = std::equal_to<T>, typename Allocator = std::allocator<T>>
const ABase & assoc::hash_set< T, Hash, Equal, Allocator >::unstable_iterable ( ) const
inline

Extract an iterable that can be iterated over even if this container is not iterable. This is intended for targeted use at places where it is actually safe to iterate over a container with unspecified order – i.e. in cases where the result does in no way depend on the iteration order. An example can be checking if a given value is present in the map.