arrow_proxy.h 344 B

1234567891011121314
  1. /**
  2. * https://quuxplusone.github.io/blog/2019/02/06/arrow-proxy/
  3. */
  4. #pragma once
  5. namespace iterator::detail {
  6. template <typename Reference> struct ArrowProxy {
  7. ArrowProxy(Reference r) : r(std::move(r)) {}
  8. Reference r;
  9. Reference * operator->() { return std::addressof(r); }
  10. };
  11. template <typename R> ArrowProxy(R r) -> ArrowProxy<R>;
  12. }