123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #ifndef BOOST_PFR_FUNCTIONS_FOR_HPP
- #define BOOST_PFR_FUNCTIONS_FOR_HPP
- #pragma once
- #include <boost/pfr/detail/config.hpp>
- #include <boost/pfr/ops_fields.hpp>
- #include <boost/pfr/io_fields.hpp>
- #define BOOST_PFR_FUNCTIONS_FOR(T) \
- BOOST_PFR_MAYBE_UNUSED inline bool operator==(const T& lhs, const T& rhs) { return ::boost::pfr::eq_fields(lhs, rhs); } \
- BOOST_PFR_MAYBE_UNUSED inline bool operator!=(const T& lhs, const T& rhs) { return ::boost::pfr::ne_fields(lhs, rhs); } \
- BOOST_PFR_MAYBE_UNUSED inline bool operator< (const T& lhs, const T& rhs) { return ::boost::pfr::lt_fields(lhs, rhs); } \
- BOOST_PFR_MAYBE_UNUSED inline bool operator> (const T& lhs, const T& rhs) { return ::boost::pfr::gt_fields(lhs, rhs); } \
- BOOST_PFR_MAYBE_UNUSED inline bool operator<=(const T& lhs, const T& rhs) { return ::boost::pfr::le_fields(lhs, rhs); } \
- BOOST_PFR_MAYBE_UNUSED inline bool operator>=(const T& lhs, const T& rhs) { return ::boost::pfr::ge_fields(lhs, rhs); } \
- template <class Char, class Traits> \
- BOOST_PFR_MAYBE_UNUSED inline ::std::basic_ostream<Char, Traits>& operator<<(::std::basic_ostream<Char, Traits>& out, const T& value) { \
- return out << ::boost::pfr::io_fields(value); \
- } \
- template <class Char, class Traits> \
- BOOST_PFR_MAYBE_UNUSED inline ::std::basic_istream<Char, Traits>& operator>>(::std::basic_istream<Char, Traits>& in, T& value) { \
- return in >> ::boost::pfr::io_fields(value); \
- } \
- BOOST_PFR_MAYBE_UNUSED inline std::size_t hash_value(const T& v) { \
- return ::boost::pfr::hash_fields(v); \
- } \
- #endif
|