考虑HowdoIwritearangepipelinethatusestemporarycontainers?.问题是如何使用一些给定的函数构建一个View来转换每个元素Tstd::vectorf(Tt);同时遵守therestriction(从那里的最佳答案借用)Aviewisalightweightwrapperthatpresentsaviewofanunderlyingsequenceofelementsinsomecustomwaywithoutmutatingorcopyingit.Viewsarecheaptocreateandcopy,andhavenon-owning