Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
misc/gen/utils.h
Go to the documentation of this file.
1#pragma once
2#include <string.h>
3
4namespace sf
5{
6
13template<typename T>
14void copy_data(T& dest, const T& src) noexcept(true)
15{
16 std::memcpy(&dest, &src, sizeof(T));
17}
18
30template<typename T>
32{
33 public:
36 {}
37
38 decltype(auto) begin()
39 {
40 return container.rbegin();
41 }
42
43 decltype(auto) end()
44 {
45 return container.rend();
46 }
47
49};
50
51}// namespace sf
Creates an adapter to reverse iterate over e.g. a std::vector or std::array.
Definition misc/gen/utils.h:32
reverse_adapter(T &container)
Definition misc/gen/utils.h:34
T & container
Definition misc/gen/utils.h:48
decltype(auto) end()
Definition misc/gen/utils.h:43
decltype(auto) begin()
Definition misc/gen/utils.h:38
Definition Application.h:10
void copy_data(T &dest, const T &src) noexcept(true)
Does a binary copy from source to destination data.
Definition misc/gen/utils.h:14