acme
Foundational cross-platform layer of the ca2 framework
Toggle main menu visibility
Loading...
Searching...
No Matches
scope_stack.h
1
//
2
// Created by camilo on 2022-10-23 09:24 <3ThomasBorregaardSorensen!!
3
//
4
#pragma once
5
6
7
template
<
typename
T >
8
class
scope_stack
9
{
10
public
:
11
12
13
T & m_reference;
14
T m_tPrevious;
15
16
17
scope_stack(T& reference,
const
T& tStack) :
18
m_reference(reference)
19
{
20
21
m_tPrevious = reference;
22
23
reference = tStack;
24
25
}
26
27
28
~scope_stack()
29
{
30
31
m_reference = m_tPrevious;
32
33
}
34
35
36
};
37
38
39
#define __scope_stack(xxxx, aaaa) auto stack_at_line ## LINE_NUMBER = ::scope_stack < ::non_reference< decltype(xxxx) >::TYPE > (xxxx, aaaa);
40
41
42
prototype
prototype
scope_stack.h
Generated by
1.17.0