diff --git a/ch10/ex10_34_35_36_37.cpp b/ch10/ex10_34_35_36_37.cpp index 2ba93d7c..9ceaa43c 100644 --- a/ch10/ex10_34_35_36_37.cpp +++ b/ch10/ex10_34_35_36_37.cpp @@ -71,8 +71,8 @@ inline void r_print(const std::vector& v) //! Exercise 10.35 inline void r_withOrdinary_print(const std::vector& v) { - for (auto it = std::prev(v.cend()); it != std::prev(v.cbegin()); --it) - std::cout << *it << " "; + for (auto iter = v.rbegin(); iter != v.rend(); ++iter) + std::cout << *iter << " "; } //! Exercise 10.36