Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Solve the Forwarding Problem and Simulate Containers of References

Have you been beaten by the argument forwarding bug? Are you frustrated by the inability to create containers of references in C++98? Find out how the reference wrapper mini-library cures these ailments.


advertisement
R1 recently enhanced the standard header <utility> with a small reference wrapping library that includes the class template reference_wrapper and the helper functions ref() and cref(). This mini-library library solves the onerous problem of argument forwarding. In addition, it enables you to simulate containers of references. The following sections explain how to do that.


How do you pass references as arguments to algorithms? How do you create containers of references?


Use reference_wrapper and its associated helper functions ref() and cref().





Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap