boostorg / describe

A C++14 reflection library
https://boost.org/libs/describe
69 stars 24 forks source link

Add operators #14

Closed pdimov closed 3 years ago

pdimov commented 3 years ago

Add a namespace boost::describe::operators containing ==, !=, <, <=, >, >=. Typical use would be

namespace user
{

struct X
{
};

BOOST_DESCRIBE_STRUCT(X, (), ())

using boost::describe::operators::operator==;
using boost::describe::operators::operator!=;

} // namespace user

Maybe add boost::describe::eq, boost::describe::lt, boost::describe::le as helper functions.

Could the operators be directly in boost::describe? (Probably not.)

pdimov commented 3 years ago

Added.

ddevienne commented 3 years ago

Just curious Peter, but why aren't the commits associated to GH Issues?

pdimov commented 3 years ago

No particular reason; there's no guarantee that things will be implemented in a single commit, although I could have used "refs".