ae2f_docs
Cast.h File Reference
#include "./Cast/CasterUnion.hpp"
#include "./Cast/Constexpr.hpp"
#include "./LangVer.auto.h"
#include "Cxx.h"
#include <stdbool.h>
#include <stddef.h>
#include "./Guide.h"

Go to the source code of this file.

Macros

#define ae2f_Cast_h
 asdf
#define ae2f_CastCCls   "\033[2J\033[H"
 ANSI Code for clearing the console. Clearing all display, moving the cursor on the top.
#define ae2f_CastMerge(...)
 simply merge all text inside the round bracket, counting them as a single text block.
#define ae2f_RecordMk(type, ...)
 Initialiser for trivial structures / classes.
#define ae2f_static_cast(t, v)
#define ae2f_dynamic_cast(t, v)
#define ae2f_reinterpret_cast(t, v)
#define ae2f_const_cast(t, v)
#define ae2f_union_cast(tThen, tNow, v)
 Makes a union that reads a memory in two methods.
tThen -> tNow
#define ae2f_struct   ae2f_WhenC(struct)
 In C, keyword 'struct' must be written in front of the structure's name in order to use as a type name.
In C++ that keyword is not required.
#define ae2f_extern   ae2f_WhenC(extern) ae2f_WhenCXX(extern "C")
 Suggests the existence of external variable or function, in naming of C. [non-mangling].
#define ae2f_class   ae2f_WhenC(struct) ae2f_WhenCXX(class)
 Class.
#define ae2f_var   ae2f_WhenCXX(extern "C")
 Makes the global variable in naming of C. [non-mangling].
#define ae2f_fdef(rtn_t, name, ...)
 Function definitions.
#define unless(...)
 Invokes when condition is false.
#define ae2f_structdef_v(key, name, ...)
#define ae2f_structdef_n(key, name, ...)
#define ae2f_structdef(key, name)
#define ae2f_enumdef(name, ...)
#define ae2f_tmpldef(...)
#define ae2f_tmpluse(...)

Detailed Description

Author
ae2f
Date
2025-02-01

Definition in file Cast.h.

Macro Definition Documentation

◆ ae2f_Cast_h

#define ae2f_Cast_h

asdf

Definition at line 15 of file Cast.h.

◆ ae2f_CastCCls

#define ae2f_CastCCls   "\033[2J\033[H"

ANSI Code for clearing the console. Clearing all display, moving the cursor on the top.

Definition at line 20 of file Cast.h.

◆ ae2f_CastMerge

#define ae2f_CastMerge ( ...)
Value:
__VA_ARGS__

simply merge all text inside the round bracket, counting them as a single text block.

Definition at line 25 of file Cast.h.

◆ ae2f_class

#define ae2f_class   ae2f_WhenC(struct) ae2f_WhenCXX(class)

Class.

Definition at line 92 of file Cast.h.

◆ ae2f_const_cast

#define ae2f_const_cast ( t,
v )
Value:
ae2f_WhenC(((t)(v))) ae2f_WhenCXX(const_cast<t>(v))
#define ae2f_WhenC(...)
Appears when the current language is C++.
Definition Cxx.h:30
#define ae2f_WhenCXX(...)
Appears when the current language is C.
Definition Cxx.h:34

const_cast

Definition at line 57 of file Cast.h.

◆ ae2f_dynamic_cast

#define ae2f_dynamic_cast ( t,
v )
Value:
ae2f_WhenC(((t)(v))) ae2f_WhenCXX(dynamic_cast<t>(v))

dynamic_cast

Definition at line 47 of file Cast.h.

◆ ae2f_enumdef

#define ae2f_enumdef ( name,
... )
Value:
typedef enum name __VA_ARGS__ name

Definition at line 111 of file Cast.h.

◆ ae2f_extern

#define ae2f_extern   ae2f_WhenC(extern) ae2f_WhenCXX(extern "C")

Suggests the existence of external variable or function, in naming of C. [non-mangling].

Definition at line 88 of file Cast.h.

◆ ae2f_fdef

#define ae2f_fdef ( rtn_t,
name,
... )
Value:
rtn_t (*name)(__VA_ARGS__)

Function definitions.

Definition at line 100 of file Cast.h.

◆ ae2f_RecordMk

#define ae2f_RecordMk ( type,
... )
Value:
(ae2f_WhenC((type){__VA_ARGS__}) ae2f_WhenCXX(type{__VA_ARGS__}))

Initialiser for trivial structures / classes.

Definition at line 37 of file Cast.h.

◆ ae2f_reinterpret_cast

#define ae2f_reinterpret_cast ( t,
v )
Value:
ae2f_WhenC(((t)(v))) ae2f_WhenCXX(reinterpret_cast<t>(v))

reinterpret_cast

Definition at line 52 of file Cast.h.

◆ ae2f_static_cast

#define ae2f_static_cast ( t,
v )
Value:
ae2f_WhenC(((t)(v))) ae2f_WhenCXX(static_cast<t>(v))

static_cast

Definition at line 42 of file Cast.h.

◆ ae2f_struct

#define ae2f_struct   ae2f_WhenC(struct)

In C, keyword 'struct' must be written in front of the structure's name in order to use as a type name.
In C++ that keyword is not required.

This keyword resolves the difference of the rules of two.

Definition at line 83 of file Cast.h.

◆ ae2f_structdef

#define ae2f_structdef ( key,
name )
Value:
ae2f_structdef_v(key, name, name)
#define ae2f_structdef_v(key, name,...)
Definition Cast.h:105

Definition at line 110 of file Cast.h.

◆ ae2f_structdef_n

#define ae2f_structdef_n ( key,
name,
... )
Value:
ae2f_structdef_v(key, name, name, __VA_ARGS__)

Definition at line 109 of file Cast.h.

◆ ae2f_structdef_v

#define ae2f_structdef_v ( key,
name,
... )
Value:
typedef key name __VA_ARGS__; \
key name

Definition at line 105 of file Cast.h.

◆ ae2f_tmpldef

#define ae2f_tmpldef ( ...)
Value:
template<__VA_ARGS__>

Definition at line 113 of file Cast.h.

◆ ae2f_tmpluse

#define ae2f_tmpluse ( ...)
Value:
<__VA_ARGS__>

Definition at line 114 of file Cast.h.

◆ ae2f_union_cast

#define ae2f_union_cast ( tThen,
tNow,
v )
Value:
ae2f_WhenC((union { \
tThen a; \
tNow b; \
}){v}) ae2f_WhenCXX(ae2f_UnionCaster<tThen, tNow>(v)) \
._b()

Makes a union that reads a memory in two methods.
tThen -> tNow

Template Parameters
tThenThe existing data's type as input.
tNowWanted output datatype for casting.
Parameters
vInput value

Definition at line 71 of file Cast.h.

◆ ae2f_var

#define ae2f_var   ae2f_WhenCXX(extern "C")

Makes the global variable in naming of C. [non-mangling].

Definition at line 96 of file Cast.h.

◆ unless

#define unless ( ...)
Value:
if (!(__VA_ARGS__))

Invokes when condition is false.

Definition at line 103 of file Cast.h.