Advertisement
AntonyZhilin

Untitled

Jan 22nd, 2024 (edited)
1,399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.39 KB | None | 0 0
  1. Index: userver/core/src/utils/statistics/impl/histogram_view_utils.hpp
  2. IDEA additional info:
  3. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  4. <+>UTF-8
  5. ===================================================================
  6. diff --git a/userver/core/src/utils/statistics/impl/histogram_view_utils.hpp b/userver/core/src/utils/statistics/impl/histogram_view_utils.hpp
  7. --- a/userver/core/src/utils/statistics/impl/histogram_view_utils.hpp   (revision 8e60cf86eddfa8956ed010dc991deeba7ba0112e)
  8. +++ b/userver/core/src/utils/statistics/impl/histogram_view_utils.hpp   (date 1705940614599)
  9. @@ -19,6 +19,14 @@
  10.  
  11.  namespace utils::statistics::impl::histogram {
  12.  
  13. +// Generic lambda crashes on GCC 8.3.0
  14. +struct BoundRefGetter {
  15. +  template <typename Bucket>
  16. +  auto& operator()(Bucket&& bucket) {
  17. +    return bucket.upper_bound.bound;
  18. +  }
  19. +};
  20. +
  21.  struct Access final {
  22.    static HistogramView MakeView(const Bucket* buckets) noexcept {
  23.      return HistogramView{buckets};
  24. @@ -32,10 +40,7 @@
  25.  
  26.    template <typename AnyHistogramView>
  27.    static auto Bounds(AnyHistogramView view) noexcept {
  28. -    const auto bound_ref_getter = [](auto&& bucket) -> auto& {
  29. -      return bucket.upper_bound.bound;
  30. -    };
  31. -    return Buckets(view) | boost::adaptors::transformed(bound_ref_getter);
  32. +    return Buckets(view) | boost::adaptors::transformed(BoundRefGetter{});
  33.    }
  34.  
  35.    template <typename AnyHistogramView>
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement