iter_ops 863 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __GBLIBCPP_BITS_ITER_OPS__
  2. #define __GBLIBCPP_BITS_ITER_OPS__
  3. namespace std {
  4. template <typename Container>
  5. constexpr auto begin(Container& c) -> decltype(c.begin())
  6. { return c.begin(); }
  7. template <typename Container>
  8. constexpr auto begin(const Container& c) -> decltype(c.begin())
  9. { return c.begin(); }
  10. template <typename Container>
  11. constexpr auto end(Container& c) -> decltype(c.end())
  12. { return c.end(); }
  13. template <typename Container>
  14. constexpr auto end(const Container& c) -> decltype(c.end())
  15. { return c.end(); }
  16. template <typename Container>
  17. constexpr auto cbegin(const Container& c)
  18. noexcept(noexcept(std::begin(c))) -> decltype(c.begin())
  19. { return c.begin(); }
  20. template <typename Container>
  21. constexpr auto cend(const Container& c)
  22. noexcept(noexcept(std::end(c))) -> decltype(c.end())
  23. { return c.end(); }
  24. } // namespace std
  25. #endif