Speeduino
Loading...
Searching...
No Matches
Functions
atomic.h File Reference
#include "src/utils/nominmax.h"
#include <tuple>
#include "board_definition.h"
#include <SimplyAtomic.h>

Go to the source code of this file.

Functions

template<typename... Args>
static auto atomic_copy (Args &&... args)
 Atomically copy the forwarding reference arguments into a std::tuple<>
 

Function Documentation

◆ atomic_copy()

template<typename... Args>
static auto atomic_copy ( Args &&...  args)
inlinestatic

Atomically copy the forwarding reference arguments into a std::tuple<>

Using a forwarding reference (Args&&...) preserves the arguments value catgeory (lvalue, rvalue) and cv-qualifier. E.g. volatile uint32_t foo; volatile uint8_t bar; // This calls atomic_copy(volatile uint32_t &, volatile uint8_t &) auto copy = atomic_copy(foo, bar);