Skip to Content
Imperfect C++ Practical Solutions for Real-Life Programming
book

Imperfect C++ Practical Solutions for Real-Life Programming

by Matthew Wilson
October 2004
Intermediate to advanced
624 pages
16h 2m
English
Addison-Wesley Professional
Content preview from Imperfect C++ Practical Solutions for Real-Life Programming

Chapter 31. Return Value Lifetime

This chapter contains much of the material from a series of installments of Flexible C++, my C/C++ User's Journal Expert's Forum column [Wils2003d, Wils2003f, Wilson2004b]. It revolves around the seemingly trivial problem of converting integers to strings in an efficient manner.

As it turns out, it's anything but a trivial issue when the details start to come out, and as well as illustrating some practical ramifications of many of the issues covered in the book so far, it brings into sharp focus the issue of Return Value Lifetime (RVL) which we discussed in the section on Conversion Shims (see sections 16.2 and 20.5).

Probably the most common way to convert integers to strings is via sprintf(), whether called directly ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical C++ Metaprogramming

Practical C++ Metaprogramming

Edouard Alligand, Joel Falcou

Publisher Resources

ISBN: 0321228774Purchase book