template class rgpot::Kept

Overview

The potential of type Pot this thread keeps. More…

#include <KeptPotential.hpp>
 
template <typename Pot>
class Kept {
public:
    // structs
 
    struct Slot;
 
    // methods
 
    template <typename Make, typename Run>
    static decltype(auto) with(const KeptKey& key, Make&& make, Run&& run);
 
    static KeptCounts counts();
    static void release();
};

Detailed Documentation

The potential of type Pot this thread keeps.

Methods

template <typename Make, typename Run>
static decltype(auto) with(const 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<Pot>, 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.

static void release()

Drops the potential this thread keeps.