Ranges-v3 proposal allows us to write code like
auto f () { return range () | view::transform ([] (auto x) { return x *2; }); }
This is very cool. But I guess that it's impossible to use such code in a reusable way (i.e. in headers), because of odr. Even worse, in every cpp file the result type of such function will be different leading to linker errors. Is the only way to use ranges in headers to write old-fashioned functor classes or I'm missing something?