A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 

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.

Note
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 761 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
inline

The functor.

Parameters
pThe Ptr value to hash.
Returns
the hash

Definition at line 768 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: