-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Christian Henning Sent: Sunday, 20 May 2007 8:41 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Converting loop to using boost::lambda wherecontainers has boost::shared_ptrs
I am glad to know I still the have skill of breaking compilers. :)
Well, I seem to have similar skills. The code below crashes my compiler ( VC7.1 SP 1), as well.
void print( const std::string& s ) { std::cout << s; }
int main ( int, char** ) { typedef boost::shared_ptr<A> A_ptr_t; typedef boost::shared_ptr<D> D_ptr_t;
typedef std::vector < boost::shared_ptr<Base> > Data_t; Data_t m_data;
A_ptr_t a ( new A ( 50 ) ); D_ptr_t d ( new D ( 30 ) );
m_data.push_back ( a ); m_data.push_back ( d );
boost::uint32_t indent_value = 4;
// this works boost::bind( &print , boost::bind( &Base::to_String , A_ptr_t( new A( 5 ) ) , indent_value ))();
// this doesn't work - ICE std::for_each ( m_data.begin(), m_data.end(), boost::bind( &print , boost::bind( &Base::to_String , boost::bind::_1 , indent_value )));
return 0; }
I know this is not the solution. I'm still using a seperate function print() for outputting. I will keep trying to solve that one.
On the other hand it would be nice if boost::bind comes some handy function like the print(). Just a thought.
Christian
To post a bug report on Microsoft Visual Studio, you need to register (with Microsoft Passport, ie., hotmail style user account). Go to http://connect.microsoft.com, log in or register, and then navigate to https://connect.microsoft.com/feedback/default.aspx?SiteID=210&wa=wsigni n1.0 You need to search feedback before you can post a new bug. Regards, Peter. Warning: Copyright ResMed. Where the contents of this email and/or attachment includes materials prepared by ResMed, the use of those materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient. This communication is confidential and may contain legally privileged information. By the use of email over the Internet or other communication systems, ResMed is not waiving either confidentiality of, or legal privilege in,the content of the email and of any attachments. If the recipient of this message is not the intended addressee, please call ResMed immediately on +61 2 8884 1000 Sydney, Australia.