arrow_proxy.h 348 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 arrow_proxy {
  7. arrow_proxy(Reference r) : r(std::move(r)) {}
  8. Reference r;
  9. Reference * operator->() { return std::addressof(r); }
  10. };
  11. template <typename R> arrow_proxy(R r) -> arrow_proxy<R>;
  12. }