Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- #include <boost/foreach.hpp>
- struct Aaa
- {
- typedef std::vector < std::string > Vec;
- Aaa()
- {
- m_vec.push_back( "sobaka" );
- m_vec.push_back( "mendeley" );
- }
- Vec m_vec;
- };
- struct Bbb
- {
- Aaa& get(){ return m_aaa; }
- Aaa m_aaa;
- };
- int main( int argc, const char* argv[] ) {
- Bbb b_obj;
- Aaa &ref_a = b_obj.get();
- BOOST_FOREACH( const Aaa::Vec::value_type &_val, ref_a.m_vec )
- {
- std::cout << _val << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment