ArkScript
A small, fast, functional and scripting language for video games
UserType.cpp
Go to the documentation of this file.
2
3namespace Ark
4{
6 {
7 if (m_funcs && m_funcs->deleter)
9 }
10
11 bool operator==(const UserType& A, const UserType& B) noexcept
12 {
13 return (A.m_type_id == B.m_type_id) && (A.m_data == B.m_data);
14 }
15
16 bool operator<(const UserType& A [[maybe_unused]], const UserType& B [[maybe_unused]]) noexcept
17 {
18 return false;
19 }
20
21 std::ostream& operator<<(std::ostream& os, const UserType& A) noexcept
22 {
23 if (A.m_funcs != nullptr && A.m_funcs->ostream_func != nullptr)
24 return A.m_funcs->ostream_func(os, A);
25
26 os << "UserType<" << A.m_type_id << ", 0x" << A.m_data << ">";
27 return os;
28 }
29}
Subtype of the value, capable of handling any C++ type.
A class to be use C++ objects in ArkScript.
Definition: UserType.hpp:50
void del()
Free memory through the control functions block.
Definition: UserType.cpp:5
ControlFuncs * m_funcs
Definition: UserType.hpp:138
void * m_data
Definition: UserType.hpp:137
std::ostream & operator<<(std::ostream &os, const std::vector< Node > &N) noexcept
Definition: Node.cpp:275
bool operator<(const Closure &A, const Closure &B) noexcept
Definition: Closure.hpp:112
bool operator==(const Closure &A, const Closure &B) noexcept
Definition: Closure.hpp:107
Definition: Builtins.hpp:21
void(* deleter)(void *)
Definition: UserType.hpp:59