oven::indirectedããã¤ã³ã¿ã®é
åããéæ¥åç
§ããç¯å²ã«å¤æãããã®ã§ããã®ã«å¯¾ãã
oven::outdirectedã¯å¤ã®é
åããã¤ã³ã¿(ãããã¯ã¤ãã¬ã¼ã¿)ã®ç¯å²ã«å¤æãã¾ãã
#include <iostream> #include <vector> #include <boost/foreach.hpp> #include <pstade/oven/initial_values.hpp> #include <pstade/oven/outdirected.hpp> #define foreach BOOST_FOREACH using namespace pstade::oven; int main() { std::vector<int> v = initial_values(3, 1, 4); foreach (std::vector<int>::const_iterator it, v|outdirected) { std::cout << *it << std::endl; } }
3 1 4
outdirectedãããã®ãindirectedããã°å ã«æ»ãã¾ãã
#include <iostream> #include <vector> #include <pstade/oven/initial_values.hpp> #include <pstade/oven/outdirected.hpp> #include <pstade/oven/indirected.hpp> #include <pstade/oven/io.hpp> using namespace pstade::oven; int main() { std::vector<int> v = initial_values(3, 1, 4); std::cout << (v|outdirected|indirected) << std::endl; // {3,1,4} }
ãåç §ã
vector<shared_ptr<T>>に対するfor_each