mirror of
https://github.com/boostorg/pfr.git
synced 2026-01-19 04:22:13 +00:00
Fixed a lot of typos
This commit is contained in:
6
doc/pfr.qbk
Normal file → Executable file
6
doc/pfr.qbk
Normal file → Executable file
@@ -475,8 +475,8 @@ By default Boost.PFR [*auto-detects your compiler abilities] and automatically d
|
||||
The Boost.PFRs reflection has some limitations that depend on a C++ Standard and compiler capabilities:
|
||||
|
||||
* Static variables are ignored
|
||||
* T must be aggregate initializable without empty base classes
|
||||
* if T contains C arrays or it is inherited from non-empty type then the result of reflection may differ depending on the C++ version and library configuration
|
||||
* T must be aggregate initializable without base classes
|
||||
* if T contains C arrays then the result of reflection may differ depending on the C++ version and library configuration
|
||||
* Additional limitations if [*BOOST_PFR_USE_CPP17 == 0]:
|
||||
* Non of the member fields should have a template constructor from one parameter.
|
||||
* Additional limitations if [*BOOST_PFR_USE_LOOPHOLE == 0]:
|
||||
@@ -518,7 +518,7 @@ Description of the [*BOOST_PFR_USE_LOOPHOLE == 1] technique by its inventor Alex
|
||||
|
||||
[section Acknowledgements]
|
||||
|
||||
Many thanks to Bruno Dutra for showing the technique to precisely reflect aggregate initializable type in C++14 [@https://github.com/apolukhin/magic_get/issues/5 Manual type registering/structured bindings might be unnecessary].
|
||||
Many thanks to Bruno Dutra for showing the technique to precisely reflect aggregate initializable type in C++14 [@https://github.com/boostorg/pfr/issues/5 Manual type registering/structured bindings might be unnecessary].
|
||||
|
||||
Many thanks to Alexandr Poltavsky for initial implementation the [*BOOST_PFR_USE_LOOPHOLE == 1] technique and for describing it [@http://alexpolt.github.io/type-loophole.html in his blog].
|
||||
|
||||
|
||||
10
include/boost/pfr/core.hpp
Normal file → Executable file
10
include/boost/pfr/core.hpp
Normal file → Executable file
@@ -97,7 +97,7 @@ using tuple_element_t = typename tuple_element<I, T>::type;
|
||||
/// \code
|
||||
/// struct my_struct { int i, short s; };
|
||||
/// my_struct s {10, 11};
|
||||
/// std::tuple<int, short> t = make_tuple(s);
|
||||
/// std::tuple<int, short> t = boost::pfr::structure_to_tuple(s);
|
||||
/// assert(get<0>(t) == 10);
|
||||
/// \endcode
|
||||
template <class T>
|
||||
@@ -119,10 +119,10 @@ constexpr auto structure_to_tuple(const T& val) noexcept {
|
||||
/// struct my_struct { int i, short s; };
|
||||
///
|
||||
/// const my_struct const_s{1, 2};
|
||||
/// std::apply(foo, structure_tie(const_s));
|
||||
/// std::apply(foo, boost::pfr::structure_tie(const_s));
|
||||
///
|
||||
/// my_struct s;
|
||||
/// structure_tie(s) = std::tuple<int, short>{10, 11};
|
||||
/// boost::pfr::structure_tie(s) = std::tuple<int, short>{10, 11};
|
||||
/// assert(s.s == 11);
|
||||
/// \endcode
|
||||
template <class T>
|
||||
@@ -177,7 +177,7 @@ constexpr auto structure_tie(T&&, std::enable_if_t< std::is_rvalue_reference<T&&
|
||||
/// \code
|
||||
/// struct my_struct { int i, short s; };
|
||||
/// int sum = 0;
|
||||
/// for_each_field(my_struct{20, 22}, [&sum](const auto& field) { sum += field; });
|
||||
/// boost::pfr::for_each_field(my_struct{20, 22}, [&sum](const auto& field) { sum += field; });
|
||||
/// assert(sum == 42);
|
||||
/// \endcode
|
||||
template <class T, class F>
|
||||
@@ -214,7 +214,7 @@ void for_each_field(T&& value, F&& func) {
|
||||
/// return res;
|
||||
/// }
|
||||
/// auto [p, s] = f();
|
||||
/// tie_from_structure(p, s) = f();
|
||||
/// boost::pfr::tie_from_structure(p, s) = f();
|
||||
/// \endcode
|
||||
template <typename... Elements>
|
||||
constexpr detail::tie_from_structure_tuple<Elements...> tie_from_structure(Elements&... args) noexcept {
|
||||
|
||||
10
include/boost/pfr/io.hpp
Normal file → Executable file
10
include/boost/pfr/io.hpp
Normal file → Executable file
@@ -89,17 +89,17 @@ enable_istreamable_t<std::basic_istream<Char, Traits>, T> operator>>(std::basic_
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/// IO manupulator to read/write \aggregate `value` using its IO stream operators or using \forcedlink{io_fields} if operators are not awailable.
|
||||
/// IO manipulator to read/write \aggregate `value` using its IO stream operators or using \forcedlink{io_fields} if operators are not awailable.
|
||||
///
|
||||
/// \b Example:
|
||||
/// \code
|
||||
/// struct my_struct { int i; short s; };
|
||||
/// my_struct s;
|
||||
/// my_struct x;
|
||||
/// std::stringstream ss;
|
||||
/// ss << "{ 12, 13 }";
|
||||
/// ss >> boost::pfr::io(s);
|
||||
/// assert(s.i == 12);
|
||||
/// assert(s.i == 13);
|
||||
/// ss >> boost::pfr::io(x);
|
||||
/// assert(x.i == 12);
|
||||
/// assert(x.s == 13);
|
||||
/// \endcode
|
||||
///
|
||||
/// \customio
|
||||
|
||||
4
include/boost/pfr/io_fields.hpp
Normal file → Executable file
4
include/boost/pfr/io_fields.hpp
Normal file → Executable file
@@ -21,7 +21,7 @@
|
||||
#include <boost/pfr/tuple_size.hpp>
|
||||
|
||||
/// \file boost/pfr/io_fields.hpp
|
||||
/// Contains IO manupulator \forcedlink{io_fields} to read/write \aggregate `value` field-by-field.
|
||||
/// Contains IO manipulator \forcedlink{io_fields} to read/write an \aggregate field-by-field.
|
||||
///
|
||||
/// \b Example:
|
||||
/// \code
|
||||
@@ -132,7 +132,7 @@ std::basic_istream<Char, Traits>& operator>>(std::basic_istream<Char, Traits>& i
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/// IO manupulator to read/write \aggregate `value` field-by-field.
|
||||
/// IO manipulator to read/write \aggregate `value` field-by-field.
|
||||
///
|
||||
/// \b Example:
|
||||
/// \code
|
||||
|
||||
4
include/boost/pfr/tuple_size.hpp
Normal file → Executable file
4
include/boost/pfr/tuple_size.hpp
Normal file → Executable file
@@ -23,7 +23,7 @@
|
||||
namespace boost { namespace pfr {
|
||||
|
||||
/// Has a static const member variable `value` that contains fields count in a T.
|
||||
/// Works for any T that supports aggregate initialization.
|
||||
/// Works for any T that satisfies \aggregate.
|
||||
///
|
||||
/// \b Example:
|
||||
/// \code
|
||||
@@ -34,7 +34,7 @@ using tuple_size = detail::size_t_< boost::pfr::detail::fields_count<T>() >;
|
||||
|
||||
|
||||
/// `tuple_size_v` is a template variable that contains fields count in a T and
|
||||
/// works for any T that supports aggregate initialization.
|
||||
/// works for any T that satisfies \aggregate.
|
||||
///
|
||||
/// \b Example:
|
||||
/// \code
|
||||
|
||||
2
test/run/error_pfr_c1202.cpp
Normal file → Executable file
2
test/run/error_pfr_c1202.cpp
Normal file → Executable file
@@ -3,7 +3,7 @@
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Example from https://github.com/apolukhin/magic_get/issues/21
|
||||
// Example from https://github.com/boostorg/pfr/issues/21
|
||||
|
||||
|
||||
// boost::pfr::for_each_field crashes when sizeof(MyConfig) > 248 (probably >= 256)
|
||||
|
||||
2
test/run/issue30.cpp
Normal file → Executable file
2
test/run/issue30.cpp
Normal file → Executable file
@@ -3,7 +3,7 @@
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Test case for https://github.com/apolukhin/magic_get/issues/30
|
||||
// Test case for https://github.com/boostorg/pfr/issues/30
|
||||
|
||||
#include <memory>
|
||||
#include <boost/pfr.hpp>
|
||||
|
||||
2
test/run/issue33.cpp
Normal file → Executable file
2
test/run/issue33.cpp
Normal file → Executable file
@@ -3,7 +3,7 @@
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Test case for https://github.com/apolukhin/magic_get/issues/33
|
||||
// Test case for https://github.com/boostorg/pfr/issues/33
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
Reference in New Issue
Block a user