This commit is contained in:
Mars 2024-06-15 16:57:16 -04:00
parent 81cb6b5d4a
commit f668a2eb4c
Signed by: pupbrained
GPG key ID: 874E22DF2F9DFCB5
4 changed files with 26 additions and 21 deletions

View file

@ -1,10 +1,27 @@
#pragma once
/**
* @brief Allows for rust-style function definitions
*/
#define fn auto
/**
* @brief Allows for easy getter creation
*
* @param class_name The class to use
* @param type Type of the getter
* @param name Name of the getter
*/
#define DEFINE_GETTER(class_name, type, name) \
fn class_name::get##name() const -> type { return m_##name; }
/**
* @brief Helper for making reflect-cpp impls
*
* @param struct_name The struct name
* @param lower_name The arg name
* @param ... Values of the class to convert
*/
#define DEF_IMPL(struct_name, lower_name, ...) \
struct struct_name##Impl { \
__VA_ARGS__; \