Qx v0.5.7
Qt Extensions Library
Loading...
Searching...
No Matches
qx-macros.h File Reference

The qx-concepts header file provides a set of various object-like and function-like macros that are designed to minimize the syntactic footprint of common tasks. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define QBAL   QByteArrayLiteral
 
#define QSL   QStringLiteral
 
#define QX_FOR_EACH(macro, ...)    __VA_OPT__(__QX_MACRO_EVALUATE(__QX_FOR_EACH_APPLY_AND_ITERATE(macro, __VA_ARGS__)))
 
#define QX_FOR_EACH_DELIM(macro, ...)    __VA_OPT__(__QX_MACRO_EVALUATE(__QX_FOR_EACH_APPLY_AND_ITERATE_DELIM(macro, __VA_ARGS__)))
 
#define QX_SCOPED_ENUM_HASH_FUNC(T)
 

Macro Definition Documentation

◆ QBAL

#define QBAL   QByteArrayLiteral

This convenience macro is an alias for QByteArrayLiteral.

◆ QSL

#define QSL   QStringLiteral

This convenience macro is an alias for QStringLiteral.

◆ QX_FOR_EACH

#define QX_FOR_EACH ( macro,
... )    __VA_OPT__(__QX_MACRO_EVALUATE(__QX_FOR_EACH_APPLY_AND_ITERATE(macro, __VA_ARGS__)))

This function-like macro acts like a fold expression for its variadic arguments. It produces the result of calling the macro macro once for each argument that follows.

For example:

#define F(x) //...
QX_FOR_EACH(F, 1, 4, 10) // -> F(1) F(4) F(10)
#define QX_FOR_EACH(macro,...)
Definition qx-macros.h:40
See also
QX_FOR_EACH_DELIM()

◆ QX_FOR_EACH_DELIM

#define QX_FOR_EACH_DELIM ( macro,
... )    __VA_OPT__(__QX_MACRO_EVALUATE(__QX_FOR_EACH_APPLY_AND_ITERATE_DELIM(macro, __VA_ARGS__)))

Same as QX_FOR_EACH(), but a comma in placed between each resultant element.

#define F(x) //...
QX_FOR_EACH_DELIM(F, 1, 4, 10) // -> F(1), F(4), F(10)
#define QX_FOR_EACH_DELIM(macro,...)
Definition qx-macros.h:43

◆ QX_SCOPED_ENUM_HASH_FUNC

#define QX_SCOPED_ENUM_HASH_FUNC ( T)
Value:
inline size_t qHash(const T& t, size_t seed) { \
return ::qHash(static_cast<typename std::underlying_type<T>::type>(t), seed); \
}

This function-like macro defines a qHash() overload for the provided scoped-enum type T.