.. index:: pair: class; rgpot::Kept .. _doxid-classrgpot_1_1_kept: template class rgpot::Kept ========================== .. toctree:: :hidden: struct_rgpot_Kept_Slot.rst Overview ~~~~~~~~ The potential of type ``Pot`` this thread keeps. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template class Kept { public: // structs struct :ref:`Slot`; // methods template static decltype(auto) :ref:`with`(const :ref:`KeptKey`& key, Make&& make, Run&& run); static :ref:`KeptCounts` :target:`counts`(); static void :ref:`release`(); }; .. _details-classrgpot_1_1_kept: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ The potential of type ``Pot`` this thread keeps. Methods ------- .. index:: pair: function; with .. _doxid-classrgpot_1_1_kept_1a2e20f21074a65edc606cf3a8f5cd899f: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static decltype(auto) with(const :ref:`KeptKey`& key, Make&& make, Run&& run) ``run(pot)`` on the potential kept for *key*. When the key differs, the kept potential is dropped and ``make()``, which returns a ``std::unique_ptr``, builds the next one. A throw from ``make`` leaves none kept. A throw from ``run`` drops the potential, whose scratch it may have left half written, and passes on. .. index:: pair: function; release .. _doxid-classrgpot_1_1_kept_1a9edccb55f26665ea8ca44ccfc8add028: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void release() Drops the potential this thread keeps.