GridFire v0.7.6rc4.0 General Purpose Nuclear Network

Loading...
Searching...
No Matches
gridfire::engine::scratch::IsScratchPad Concept Reference

Concept that constrains types to valid scratchpad implementations. More...

`#include <blob.h>`

## Concept definition

template<typename T>
concept gridfire::engine::scratch::IsScratchPad = std::is_base_of_v<AbstractScratchPad, T>
&& requires { { T::ID } -> std::convertible_to<ScratchPadType>; }
gridfire::engine::scratch::IsScratchPad
Concept that constrains types to valid scratchpad implementations.
Definition blob.h:90

## Detailed Description

Concept that constrains types to valid scratchpad implementations.

A type satisfies IsScratchPad if:

- It derives from AbstractScratchPad
- It has a static ID member convertible to ScratchPadType

Template Parameters

  T | The type to check against the concept.

Examples
  // This will compile only if MyScratchPad satisfies IsScratchPad
  template <IsScratchPad T>
  void process_scratchpad(T& scratch) {
  // Use scratch...
  }
  gridfire::engine::scratch
  Scratchpad memory management for computational engines.
  Definition blob.h:69