Skip to content
Snippets Groups Projects

replace range::v3 with std::ranges

Merged Gerhard Raven requested to merge prefer_std_ranges into master
All threads resolved!
10 files
+ 16
36
Compare changes
  • Side-by-side
  • Inline
Files
10
@@ -11,10 +11,8 @@
#pragma once
#include "DetDesc/SolidChild.h"
#include "DetDesc/SolidTicks.h"
#include "range/v3/view/const.hpp"
#include "range/v3/view/indirect.hpp"
#include "range/v3/view/span.hpp"
#include <algorithm>
#include <ranges>
#include <string>
#include <vector>
@@ -134,7 +132,9 @@ public:
/** acess to range of const children
* @return "range"
*/
auto children() const { return ranges::span( m_sb_childrens ) | ranges::views::indirect | ranges::views::const_; }
auto children() const {
return std::ranges::transform_view( m_sb_childrens, []( auto const& i ) -> SolidChild const& { return *i; } );
}
/** access to the childrens by index
* @param index index of child solid
@@ -180,7 +180,9 @@ protected:
/** acess to range of children
* @return "range"
*/
auto children() { return ranges::span( m_sb_childrens ) | ranges::views::indirect; }
auto children() {
return std::ranges::transform_view( m_sb_childrens, []( auto& i ) -> SolidChild& { return *i; } );
}
/** Calculate the maximum number of ticks that a straight line could
make with this solid
Loading