P4C
The P4 Compiler
Loading...
Searching...
No Matches
assoc::detail::CondIterableAssocBase< Base, Itble, typename > Class Template Reference

#include <assoc.h>

Inheritance diagram for assoc::detail::CondIterableAssocBase< Base, Itble, typename >:
[legend]

Public Types

using hasher = typename Base::hasher
 
using key_equal = typename Base::key_equal
 

Static Public Attributes

static constexpr bool iterable = Itble == Iterable::Yes
 

Detailed Description

template<typename Base, Iterable Itble, typename = void>
class assoc::detail::CondIterableAssocBase< Base, Itble, typename >

Base of our conditionally-iterable associative containers used for unsorted (hashed) containers. In this case, the iteration order is never stable, even for containers over stable elements. Therefore, we just disable iteration, except if explicitly enabled.

Member Data Documentation

◆ iterable

template<typename Base , Iterable Itble, typename = void>
bool assoc::detail::CondIterableAssocBase< Base, Itble, typename >::iterable = Itble == Iterable::Yes
staticconstexpr

Hash based containers are never iterable unless explicitly enabled. The ordering is never stable and the order of element in the container might even change if some other elements are inserted and/or deleted.