mirror of
https://github.com/boostorg/pfr.git
synced 2026-01-19 04:22:13 +00:00
fix lint issues
This commit is contained in:
@@ -40,8 +40,8 @@ constexpr auto get_name() noexcept {
|
||||
template <class T>
|
||||
constexpr auto names_as_array() noexcept {
|
||||
return detail::make_stdarray_from_tietuple(
|
||||
detail::tie_as_names_tuple<T>(),
|
||||
detail::make_index_sequence< tuple_size_v<T> >()
|
||||
detail::tie_as_names_tuple<T>(),
|
||||
detail::make_index_sequence< tuple_size_v<T> >()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ template <class T>
|
||||
constexpr auto tie_as_names_tuple() noexcept {
|
||||
static_assert(
|
||||
sizeof(T) && false,
|
||||
"====================> Boost.PFR: Extraction of field's names is allowed only in C++20"
|
||||
"====================> Boost.PFR: Extraction of field's names is allowed only in C++20"
|
||||
);
|
||||
|
||||
return detail::make_sequence_tuple();
|
||||
|
||||
@@ -67,7 +67,7 @@ constexpr auto tie_as_names_tuple() noexcept {
|
||||
);
|
||||
static_assert(
|
||||
sizeof(T) && BOOST_PFR_USE_CPP17,
|
||||
"====================> Boost.PFR: Extraction of field's names is allowed only when the BOOST_PFR_USE_CPP17 macro enabled."
|
||||
"====================> Boost.PFR: Extraction of field's names is allowed only when the BOOST_PFR_USE_CPP17 macro enabled."
|
||||
);
|
||||
|
||||
return tie_as_names_tuple_impl<T>(detail::make_index_sequence<detail::fields_count<T>()>{});
|
||||
|
||||
@@ -14,7 +14,7 @@ int main() {
|
||||
<< "BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE == " << BOOST_PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE << '\n'
|
||||
<< "BOOST_PFR_HAS_GUARANTEED_COPY_ELISION == " << BOOST_PFR_HAS_GUARANTEED_COPY_ELISION << '\n'
|
||||
<< "BOOST_PFR_ENABLE_IMPLICIT_REFLECTION == " << BOOST_PFR_ENABLE_IMPLICIT_REFLECTION << '\n'
|
||||
<< "BOOST_PFR_ENABLE_GETTING_NAMES == " << BOOST_PFR_ENABLE_GETTING_NAMES << '\n'
|
||||
<< "BOOST_PFR_ENABLE_GETTING_NAMES == " << BOOST_PFR_ENABLE_GETTING_NAMES << '\n'
|
||||
<< "BOOST_PFR_ENABLED == " << BOOST_PFR_ENABLED << '\n'
|
||||
<< "__cplusplus == " << __cplusplus << '\n'
|
||||
#ifdef __cpp_structured_bindings
|
||||
|
||||
@@ -47,9 +47,9 @@ void test_get_name_by_type() {
|
||||
void test_names_as_array() {
|
||||
const auto expected = std::array<std::string_view, 4>{
|
||||
"member1",
|
||||
"this_is_a_name",
|
||||
"c",
|
||||
"Forth"
|
||||
"this_is_a_name",
|
||||
"c",
|
||||
"Forth"
|
||||
};
|
||||
const auto value = boost::pfr::names_as_array<Aggregate>();
|
||||
BOOST_TEST_EQ(expected.size(), value.size());
|
||||
|
||||
@@ -30,11 +30,11 @@ static_assert(boost::pfr::get_name<2, Aggregate>() == "c");
|
||||
static_assert(boost::pfr::get_name<3, Aggregate>() == "Forth");
|
||||
|
||||
static_assert(boost::pfr::names_as_array<Aggregate>() == std::array<std::string_view, 4>{
|
||||
"member1",
|
||||
"this_is_a_name",
|
||||
"c",
|
||||
"Forth"
|
||||
});
|
||||
"member1",
|
||||
"this_is_a_name",
|
||||
"c",
|
||||
"Forth"
|
||||
});
|
||||
|
||||
int main() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user