summaryrefslogtreecommitdiffhomepage
path: root/compat/defs.hpp
blob: e4b9226035c05226f6af99f0789f4aa7f7c191d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once

#ifdef _MSC_VER
#   define fm_FUNCTION_NAME __FUNCSIG__
#else
#   define fm_FUNCTION_NAME __PRETTY_FUNCTION__
#endif

#define fm_begin(...) [&]{__VA_ARGS__}()

#define fm_DECLARE_DEPRECATED_COPY_ASSIGNMENT(type)                 \
    [[deprecated]] type(const type&) noexcept = default;            \
    [[deprecated]] type& operator=(const type&) noexcept = default

#define fm_DECLARE_DEFAULT_COPY_ASSIGNMENT(type)                    \
    constexpr type(const type&) noexcept = default;                 \
    constexpr type& operator=(const type&) noexcept = default

#define fm_DECLARE_DEFAULT_COPY_ASSIGNMENT_(type)                   \
    type(const type&) noexcept = default;                           \
    type& operator=(const type&) noexcept = default

#define fm_DECLARE_DELETED_COPY_ASSIGNMENT(type)                    \
    type(const type&) = delete;                                     \
    type& operator=(const type&) = delete

#define fm_DECLARE_DELETED_MOVE_ASSIGNMENT(type)                    \
    type(type&&) = delete;                                          \
    type& operator=(type&&) = delete

#define fm_DECLARE_DEPRECATED_MOVE_ASSIGNMENT(type)                 \
    [[deprecated]] type(type&&) = default;                          \
    [[deprecated]] type& operator=(type&&) = default

#define fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT(type)                    \
    constexpr type(type&&) noexcept = default;                      \
    constexpr type& operator=(type&&) noexcept = default

#define fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT_(type)                   \
    type(type&&) noexcept = default;                                \
    type& operator=(type&&) noexcept = default

#define fm_DECLARE_DEFAULT_MOVE_COPY_ASSIGNMENTS(type)              \
    fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT(type);                       \
    fm_DECLARE_DEFAULT_COPY_ASSIGNMENT(type)

#define fm_DECLARE_DEFAULT_MOVE_COPY_ASSIGNMENTS_(type)             \
    fm_DECLARE_DEFAULT_MOVE_ASSIGNMENT_(type);                      \
    fm_DECLARE_DEFAULT_COPY_ASSIGNMENT_(type)