{"action":"closed","issue":{"url":"https://api.github.com/repos/USCiLab/cereal/issues/154","labels_url":"https://api.github.com/repos/USCiLab/cereal/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/USCiLab/cereal/issues/154/comments","events_url":"https://api.github.com/repos/USCiLab/cereal/issues/154/events","html_url":"https://github.com/USCiLab/cereal/issues/154","id":53894030,"number":154,"title":"use of ranged for","user":{"login":"javenPHD","id":10266249,"avatar_url":"https://avatars.githubusercontent.com/u/10266249?v=3","gravatar_id":"","url":"https://api.github.com/users/javenPHD","html_url":"https://github.com/javenPHD","followers_url":"https://api.github.com/users/javenPHD/followers","following_url":"https://api.github.com/users/javenPHD/following{/other_user}","gists_url":"https://api.github.com/users/javenPHD/gists{/gist_id}","starred_url":"https://api.github.com/users/javenPHD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javenPHD/subscriptions","organizations_url":"https://api.github.com/users/javenPHD/orgs","repos_url":"https://api.github.com/users/javenPHD/repos","events_url":"https://api.github.com/users/javenPHD/events{/privacy}","received_events_url":"https://api.github.com/users/javenPHD/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-09T17:42:05Z","updated_at":"2015-01-09T18:21:12Z","closed_at":"2015-01-09T18:21:12Z","body":"I am wondering if there is a reason why ranged for's are not used in the code when they would be appropriate. This is seen in vector.hpp for example. You are still using the older iteration using an iterator. Would it not be more suitable and easier to read if you used the ranged for.\r\n\r\nBEFORE\r\n\r\n//! Serialization for non-arithmetic vector types\r\n  template <class Archive, class T, class A> inline\r\n  typename std::enable_if<!traits::is_input_serializable<BinaryData<T>, Archive>::value\r\n                          || !std::is_arithmetic<T>::value, void>::type\r\n  load( Archive & ar, std::vector<T, A> & vector )\r\n  {\r\n    size_type size;\r\n    ar( make_size_tag( size ) );\r\n\r\n    vector.resize( static_cast<std::size_t>( size ) );\r\n    for( auto it = vector.begin(), end = vector.end(); it != end; ++it )\r\n      ar( *it );\r\n  }\r\n\r\n\r\nAFTER\r\n\r\n//! Serialization for non-arithmetic vector types\r\n  template <class Archive, class T, class A> inline\r\n  typename std::enable_if<!traits::is_input_serializable<BinaryData<T>, Archive>::value\r\n                          || !std::is_arithmetic<T>::value, void>::type\r\n  load( Archive & ar, std::vector<T, A> & vector )\r\n  {\r\n    size_type size;\r\n    ar( make_size_tag( size ) );\r\n\r\n    vector.resize( static_cast<std::size_t>( size ) );\r\n    for( auto & values : vector )\r\n      ar( values );\r\n  }\r\n\r\nJust a thought."}}