A Discrete-Event Network Simulator
std::hash< ns3::Ptr< T > > Struct Template Reference

Hashing functor taking a Ptr and returning a std::size_t. More...

#include "ptr.h"

Public Member Functions

std::size_t operator() (ns3::Ptr< T > p) const
 The functor. More...

Detailed Description

template<class T>
struct std::hash< ns3::Ptr< T > >

Hashing functor taking a Ptr and returning a std::size_t.

For use with unordered_map and unordered_set.

When a Ptr is used in a container the lifetime of the underlying object is at least as long as the container. In other words, you need to remove the object from the container when you are done with it, otherwise the object will persist until the container itself is deleted.
Template Parameters
T[deduced] The type held by the Ptr

Definition at line 717 of file ptr.h.

Member Function Documentation

◆ operator()()

template<class T >
std::size_t std::hash< ns3::Ptr< T > >::operator() ( ns3::Ptr< T >  p) const

The functor.

pThe Ptr value to hash.
the hash

Definition at line 726 of file ptr.h.

References ns3::PeekPointer().

+ Here is the call graph for this function:

The documentation for this struct was generated from the following file: