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:48
void del()
Free memory through the control functions block.
Definition UserType.cpp:5
ControlFuncs * m_funcs
Definition UserType.hpp:143
bool operator<(const Namespace &, const Namespace &)
Definition Namespace.hpp:27
bool operator==(const Namespace &A, const Namespace &B)
Definition Namespace.hpp:21
std::ostream & operator<<(std::ostream &os, const UserType &A) noexcept
Definition UserType.cpp:21
void(* deleter)(void *)
Definition UserType.hpp:57