identity.h 287 B

1234567891011121314151617181920
  1. //
  2. // identity.h
  3. // stream
  4. //
  5. // Created by Sam Jaffe on 3/29/23.
  6. //
  7. #pragma once
  8. #include <utility>
  9. #include <stream/forward.h>
  10. namespace stream::detail {
  11. struct identity {
  12. template <typename T> decltype(auto) operator()(T && t) const {
  13. return std::forward<T>(t);
  14. }
  15. };
  16. }