mirror of
https://github.com/boostorg/pfr.git
synced 2026-01-19 04:22:13 +00:00
improve docs (refs #55)
This commit is contained in:
@@ -9,8 +9,8 @@ This is a C++14 library for very basic reflection that gives you access to struc
|
||||
|
||||
Branches | Build | Tests coverage | More info
|
||||
----------------|-------------- | -------------- |-----------
|
||||
Develop: | [](https://travis-ci.org/apolukhin/magic_get) [](https://ci.appveyor.com/project/apolukhin/magic-get/branch/develop) | [](https://coveralls.io/github/apolukhin/magic_get?branch=develop) | <!-- [details...](http://www.boost.org/development/tests/develop/developer/pfr.html)) -->
|
||||
Master: | [](https://travis-ci.org/apolukhin/magic_get) [](https://ci.appveyor.com/project/apolukhin/magic-get/branch/master) | [](https://coveralls.io/github/apolukhin/magic_get?branch=master) | <!-- [details...](http://www.boost.org/development/tests/master/developer/pfr.html)) -->
|
||||
Develop: | [](https://travis-ci.org/apolukhin/magic_get) [](https://ci.appveyor.com/project/apolukhin/magic-get/branch/develop) | [](https://coveralls.io/github/apolukhin/magic_get?branch=develop) | <!-- [details...](http://www.boost.org/development/tests/develop/developer/pfr.html)) -->
|
||||
Master: | [](https://travis-ci.org/apolukhin/magic_get) [](https://ci.appveyor.com/project/apolukhin/magic-get/branch/master) | [](https://coveralls.io/github/apolukhin/magic_get?branch=master) | <!-- [details...](http://www.boost.org/development/tests/master/developer/pfr.html)) -->
|
||||
|
||||
### Motivating Example #0
|
||||
```c++
|
||||
|
||||
@@ -33,53 +33,65 @@
|
||||
/// \b Synopsis:
|
||||
namespace boost { namespace pfr {
|
||||
|
||||
/// Does a field-by-field comparison.
|
||||
/// Does a field-by-field equality comparison.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) == std::tie( _rhs-fields_ )`
|
||||
/// Let MIN be std::min(tuple_size_v<T>, tuple_size_v<U>). Let _lhs-fields_ and _rhs-fields_ be the tuples of MIN fields of lhs and rhs correspondingly.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) == std::tie( _rhs-fields_ ) && tuple_size_v<T> == tuple_size_v<U>`
|
||||
template <class T, class U>
|
||||
bool eq_fields(const T& lhs, const U& rhs) noexcept {
|
||||
return detail::binary_visit<detail::equal_impl>(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/// Does a field-by-field comparison.
|
||||
/// Does a field-by-field inequality comparison.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) != std::tie( _rhs-fields_ )`
|
||||
/// Let MIN be std::min(tuple_size_v<T>, tuple_size_v<U>). Let _lhs-fields_ and _rhs-fields_ be the tuples of MIN fields of lhs and rhs correspondingly.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) != std::tie( _rhs-fields_ ) || tuple_size_v<T> != tuple_size_v<U>`
|
||||
template <class T, class U>
|
||||
bool ne_fields(const T& lhs, const U& rhs) noexcept {
|
||||
return detail::binary_visit<detail::not_equal_impl>(lhs, rhs);
|
||||
}
|
||||
|
||||
/// Does a field-by-field comparison.
|
||||
/// Does a field-by-field greter comparison.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) > std::tie( _rhs-fields_ )`
|
||||
/// Let MIN be std::min(tuple_size_v<T>, tuple_size_v<U>). Let _lhs-fields_ and _rhs-fields_ be the tuples of MIN fields of lhs and rhs correspondingly.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) > std::tie( _rhs-fields_ ) || (std::tie( _lhs-fields_ ) == std::tie( _rhs-fields_ ) && tuple_size_v<T> > tuple_size_v<U>)`
|
||||
template <class T, class U>
|
||||
bool gt_fields(const T& lhs, const U& rhs) noexcept {
|
||||
return detail::binary_visit<detail::greater_impl>(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/// Does a field-by-field comparison.
|
||||
/// Does a field-by-field less comparison.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) < std::tie( _rhs-fields_ )`
|
||||
/// Let MIN be std::min(tuple_size_v<T>, tuple_size_v<U>). Let _lhs-fields_ and _rhs-fields_ be the tuples of MIN fields of lhs and rhs correspondingly.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) < std::tie( _rhs-fields_ ) || (std::tie( _lhs-fields_ ) == std::tie( _rhs-fields_ ) && tuple_size_v<T> < tuple_size_v<U>)`
|
||||
template <class T, class U>
|
||||
bool lt_fields(const T& lhs, const U& rhs) noexcept {
|
||||
return detail::binary_visit<detail::less_impl>(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/// Does a field-by-field comparison.
|
||||
/// Does a field-by-field greater equal comparison.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) >= std::tie( _rhs-fields_ )`
|
||||
/// Let MIN be std::min(tuple_size_v<T>, tuple_size_v<U>). Let _lhs-fields_ and _rhs-fields_ be the tuples of MIN fields of lhs and rhs correspondingly.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) > std::tie( _rhs-fields_ ) || (std::tie( _lhs-fields_ ) == std::tie( _rhs-fields_ ) && tuple_size_v<T> >= tuple_size_v<U>)`
|
||||
template <class T, class U>
|
||||
bool ge_fields(const T& lhs, const U& rhs) noexcept {
|
||||
return detail::binary_visit<detail::greater_equal_impl>(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/// Does a field-by-field comparison.
|
||||
/// Does a field-by-field less equal comparison.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) <= std::tie( _rhs-fields_ )`
|
||||
/// Let MIN be std::min(tuple_size_v<T>, tuple_size_v<U>). Let _lhs-fields_ and _rhs-fields_ be the tuples of MIN fields of lhs and rhs correspondingly.
|
||||
///
|
||||
/// \returns `std::tie( _lhs-fields_ ) < std::tie( _rhs-fields_ ) || (std::tie( _lhs-fields_ ) == std::tie( _rhs-fields_ ) && tuple_size_v<T> <= tuple_size_v<U>)`
|
||||
template <class T, class U>
|
||||
bool le_fields(const T& lhs, const U& rhs) noexcept {
|
||||
return detail::binary_visit<detail::less_equal_impl>(lhs, rhs);
|
||||
|
||||
Reference in New Issue
Block a user