cxxomfort  rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
Macros
relationals.hpp File Reference

Macros for generating relational operators. More...

Macros

#define CXXO_GENERATE_RELATIONALS2(L, R)
 Automatically generates relational operators between the classes L and R . More...
 
#define CXXO_GENERATE_RELATIONALS(T)
 Automatically generates nonmember relational operators >, >=, <= and != . More...
 

Detailed Description

Macros for generating relational operators.

Macro Definition Documentation

◆ CXXO_GENERATE_RELATIONALS2

#define CXXO_GENERATE_RELATIONALS2 (   L,
 
)

Automatically generates relational operators between the classes L and R .

If classes L and R have working operators == and <, invoking this macro outside their class definition will automatically generate compatible non-member operators != , <= , >, >= .

All generated operators have the signature bool(L const&, R const&) and are noexcept or throw() .

◆ CXXO_GENERATE_RELATIONALS

#define CXXO_GENERATE_RELATIONALS (   T)

Automatically generates nonmember relational operators >, >=, <= and != .

If class T has working operators == and <, invoking this macro outside the class definition will automatically generate compatible non-member operators != , <= , >, >= .

All generated operators return bool and are noexcept or throw() .