Created
January 5, 2011 06:05
-
-
Save hajimehoshi/765993 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <boost/range.hpp> | |
class foo { | |
private: | |
int values_[10]; | |
public: | |
typedef decltype(values_) values_type; | |
foo() | |
: values_{3, 1, 4, 1, 5, 9, 2, 6, 5, 3} { | |
} | |
const values_type& | |
values() { | |
return this->values_; | |
} | |
}; | |
int main() { | |
foo foo_; | |
auto it = boost::begin(foo_.values()); | |
auto it_end = boost::end(foo_.values()); | |
for (; it != it_end; ++it) { | |
std::cout << *it << std::endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment