Skip to content

Commit

Permalink
fixed ci errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fktn-k committed Jan 6, 2025
1 parent 84bdf33 commit 147cbed
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
17 changes: 15 additions & 2 deletions include/fkYAML/detail/iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,28 @@ FK_YAML_DETAIL_NAMESPACE_END

namespace std {

#ifdef __clang__
// clang emits warnings against mixed usage of class/struct for tuple_size/tuple_element.
// see also: https://groups.google.com/a/isocpp.org/g/std-discussion/c/QC-AMb5oO1w
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmismatched-tags"
#endif

template <typename ValueType>
class tuple_size<::fkyaml::detail::iterator<ValueType>> : public integral_constant<size_t, 2> {};
// NOLINTNEXTLINE(cert-dcl58-cpp)
struct tuple_size<::fkyaml::detail::iterator<ValueType>> : public integral_constant<size_t, 2> {};

template <size_t N, typename ValueType>
class tuple_element<N, ::fkyaml::detail::iterator<ValueType>> {
// NOLINTNEXTLINE(cert-dcl58-cpp)
struct tuple_element<N, ::fkyaml::detail::iterator<ValueType>> {
public:
using type = decltype(get<N>(std::declval<::fkyaml::detail::iterator<ValueType>>()));
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif

} // namespace std

#endif /* FK_YAML_DETAIL_ITERATOR_HPP */
17 changes: 15 additions & 2 deletions single_include/fkYAML/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10175,15 +10175,28 @@ FK_YAML_DETAIL_NAMESPACE_END

namespace std {

#ifdef __clang__
// clang emits warnings against mixed usage of class/struct for tuple_size/tuple_element.
// see also: https://groups.google.com/a/isocpp.org/g/std-discussion/c/QC-AMb5oO1w
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmismatched-tags"
#endif

template <typename ValueType>
class tuple_size<::fkyaml::detail::iterator<ValueType>> : public integral_constant<size_t, 2> {};
// NOLINTNEXTLINE(cert-dcl58-cpp)
struct tuple_size<::fkyaml::detail::iterator<ValueType>> : public integral_constant<size_t, 2> {};

template <size_t N, typename ValueType>
class tuple_element<N, ::fkyaml::detail::iterator<ValueType>> {
// NOLINTNEXTLINE(cert-dcl58-cpp)
struct tuple_element<N, ::fkyaml::detail::iterator<ValueType>> {
public:
using type = decltype(get<N>(std::declval<::fkyaml::detail::iterator<ValueType>>()));
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif

} // namespace std

#endif /* FK_YAML_DETAIL_ITERATOR_HPP */
Expand Down

0 comments on commit 147cbed

Please sign in to comment.