mimic++ v9.2.1
Loading...
Searching...
No Matches
mimicpp::util::pass_key< Trusted > Struct Template Reference

A helper type that enables fine-grained access control to specific functions without using friend declarations. More...

#include <PassKey.hpp>

Detailed Description

template<typename Trusted>
struct mimicpp::util::pass_key< Trusted >

A helper type that enables fine-grained access control to specific functions without using friend declarations.

Template Parameters
TrustedThe type that is allowed to create this key and therefore granted access.

This type provides a way to restrict access to certain functions by requiring a special key object. Only the designated Trusted type can construct this key, allowing it to call functions that accept the key as a parameter. This avoids broad friendship declarations and keeps access control explicit and localized.

See also
https://speakerdeck.com/rollbear/using-types-to-save-your-codes-future?slide=54

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