Cannot use ranges::view::zip with Gaudi::Functional::vector_of_const_
Take the following toy algorithm:
using ints = Gaudi::Functional::vector_of_const_<int>;
using out_t = std::tuple<float, float>;
using base_t = Gaudi::Functional::MergingMultiTransformer<out_t( ints const& )>;
struct alg : public base_t {
alg( std::string const& name, ISvcLocator* pSvcLocator )
: base_t( name, pSvcLocator, {"InputInts", {"firstInt", "secondInt"}},
{KeyValue{"O1", "firstFloat"}, KeyValue{"O2", "secondFloat"}} ) {}
out_t operator()( ints const& vec ) const override {
float f1 = 1, f2 = 1;
for ( const auto& [i1] : ranges::view::zip( vec.at(0) )) {
}
return out_t{f1, f2};
}
};
Compiling gives the error:
../GaudiExamples/src/FunctionalAlgorithms/merging_transformer.cpp: In member function ‘virtual out_t is2ff_merger::operator()(const ints&) const’:
../GaudiExamples/src/FunctionalAlgorithms/merging_transformer.cpp:16:58: error: forming reference to void
for ( const auto& [i1] : ranges::view::zip( is.at(0) )) {
^
In file included from ../GaudiAlg/GaudiAlg/FunctionalDetails.h:19,
from ../GaudiAlg/GaudiAlg/MergingTransformer.h:9,
from ../GaudiExamples/src/FunctionalAlgorithms/merging_transformer.cpp:1:
/cvmfs/lhcb.cern.ch/lib/lcg/releases/rangev3/0.4.0-d4306/x86_64-centos7-gcc8-dbg/include/range/v3/view/zip.hpp: In instantiation of ‘void ranges::v3::view::zip_fn::operator()(Rngs&& ...) const [with Rngs = {const int&}; bool _concept_requires_134 = false; typename std::enable_if<(_concept_requires_134 || (! typename meta::v1::defer<meta::v1::detail::_and_<(0 == sizeof... (ranges::v3::InputRange<Rngs>))>::template invoke, ranges::v3::InputRange<Rngs>...>::type()))>::type* <anonymous> = 0]’:
../GaudiExamples/src/FunctionalAlgorithms/merging_transformer.cpp:16:58: required from here
/cvmfs/lhcb.cern.ch/lib/lcg/releases/rangev3/0.4.0-d4306/x86_64-centos7-gcc8-dbg/include/range/v3/view/zip.hpp:137:46: error: static assertion failed: All of the objects passed to view::zip must model the InputRange concept
CONCEPT_ASSERT_MSG(meta::and_<InputRange<Rngs>...>(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~
It seems that Gaudi::Functional::vector_of_const_
doesn't behave exactly like a std::vector
for this purpose. Is that expected?