2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00

Fix typos (#139)

This commit is contained in:
Denis Mikhailov
2023-09-19 11:46:52 +03:00
committed by GitHub
parent 67f4fc4398
commit 730f40b6b2
4 changed files with 8 additions and 10 deletions

View File

@@ -541,13 +541,13 @@ To do that:
* `skip_at_begin` is equal to characters count before the first occurrence of `user_defined_field` in output
* `skip_at_end` is equal to characters count after last occurrence of `user_defined_field` in output
# Check that `test/core_name/print_name.cpp` returns "user_defined_field"
# If it does not return `fn`, then define BOOST_PFR_CORE_NAME_PARSING to `(skip_at_begin, skip_at_end, "T = ")`, where
# If it does not return `user_defined_field`, then define BOOST_PFR_CORE_NAME_PARSING to `(skip_at_begin, skip_at_end, "T = ")`, where
* `skip_at_begin` is equal to `skip_at_begin` at step 2
* `skip_at_end` is equal to `skip_at_end` at step 2
* `"T = "` is equal to characters that are right before the `user_defined_field` in output, use `backward("T = ")` to search for the occurange in the string from the right
# (optional, but highly recommended) [@https://github.com/boostorg/pfr/issues create ticket] with
feature request to add your compiler to supported compilers list. Include
parameters provided to `BOOST_PFR_CORE_NAME_PARSING` macro [*and] the initial output if `test/core_name/print_name.cpp`.
parameters provided to `BOOST_PFR_CORE_NAME_PARSING` macro [*and] the initial output of `test/core_name/print_name.cpp`.
[endsect]

View File

@@ -28,15 +28,15 @@ struct foo { // defining structure
/*`
We can access field's names of that structure by index:
*/
constexpr std::string_view r1 = boost::pfr::get_name<0, foo>(); // returns "some_integer"
constexpr std::string_view r2 = boost::pfr::get_name<1, foo>(); // returns "c"
constexpr std::string_view n1 = boost::pfr::get_name<0, foo>(); // returns "some_integer"
constexpr std::string_view n2 = boost::pfr::get_name<1, foo>(); // returns "c"
//] [/pfr_example_get_name]
#endif
int main() {
#if BOOST_PFR_CORE_NAME_ENABLED && BOOST_PFR_USE_CPP17
if (r1 != "some_integer") return 1;
if (r2 != "c") return 2;
if (n1 != "some_integer") return 1;
if (n2 != "c") return 2;
#endif
return 0;

View File

@@ -64,8 +64,8 @@ get_name() noexcept {
/// \b Example:
/// \code
/// struct my_struct { int i, short s; };
/// std::array<std::string_view, 2> t = boost::pfr::names_as_array<my_struct>();
/// assert(t[0] == "i");
/// std::array<std::string_view, 2> a = boost::pfr::names_as_array<my_struct>();
/// assert(a[0] == "i");
/// \endcode
template <class T>
constexpr

View File

@@ -36,8 +36,6 @@ find ${TARGET_PATH} -type f | xargs sed -i 's|boost/pfr|pfr|g'
find ${TARGET_PATH}/doc -type f | xargs sed -i 's|boost.pfr.|pfr.|g'
find ${TARGET_PATH}/doc -type f | xargs sed -i 's|Boost.PFR|PFR|g'
sed -i 's/[0-9]* \/\*\([0-9]*\) for non boost\*\/\+/\1/g' ${TARGET_PATH}/include/pfr/config.hpp
sed -i 's|# \[Boost.PFR\](https://boost.org/libs/pfr)|# [PFR](https://apolukhin.github.io/pfr_non_boost/)|g' ${TARGET_PATH}/README.md
echo -n "***** Testing: "