Читаем Thinking In C++. Volume 2: Practical Programming полностью

[27] Thanks to Reg Charney of the C++ Standards Committee for suggesting this trick.

[28] Some of the material in this chapter was originally created by Nancy Nicolaisen.

[29] It’s difficult to make reference-counting implementations thread safe. (See Herb Sutter, More Exceptional C++, pp. 104–14). See Chapter 10 for more on programming with multiple threads.

[30] It as an abbreviation for "no position."

[31] Discussed in depth in Chapter 6.

[32] To keep the exposition simple, this version does not handle nested tags, such as comments.

[33] It is tempting to use mathematics here to factor out some of these calls to erase( ), but since in some cases one of the operands is string::npos (the largest unsigned integer available), integer overflow occurs and wrecks the algorithm.

[34] Alert: For the safety reasons mentioned, the C++ Standards Committee is considering a proposal to redefine string::operator[] to behave identically to string::at() for C++0x.

[35] Your implementation can define all three template arguments here. Because the last two template parameters have default arguments, such a declaration is equivalent to what we show here.

[36] Beware that some versions of Microsoft Word erroneously replace single quote characters with an extended ASCII character when you save a document as text, which of course causes a compile error. We have no idea why this happens. Just replace the character manually with an apostrophe.

[37] POSIX, an IEEE standard, stands for "Portable Operating System Interface" and is a generalization of many of the low-level system calls found in UNIX systems.

[38] The implementation and test files for FULLWRAP are available in the freely distributed source code for this book. See the preface for details.

[39] Explained in depth in Chapter 5.

[40] For this reason, we can write ios::failbit instead of ios_base::failbit to save typing.

[41] It is customary to use operator void*( ) in preference to operator bool( ) because the implicit conversions from bool to int may cause surprises, should you errantly place a stream in a context where an integer conversion can be applied. The operator void*( ) function will only implicitly be called in the body of a Boolean expression.

[42] An integral type used to hold single-bit flags.

[43] A more in-depth treatment of stream buffers and streams in general can be found in Langer & Kreft’s, Standard C++ IOStreams and Locales, Addison-Wesley, 1999.

[44] For more information on machine epsilon and floating-point computation in general, see Chuck’s article, "The Standard C Library, Part 3", C/C++ Users Journal, March 1995, also available at www.freshsources.com/1995006a.htm.

[45] Before putting nl into a header file, make it an inline function (see Chapter 7).

[46] Jerry Schwarz is the designer of iostreams.

[47] See the Langer & Kreft book mentioned earlier for more detailed information.

[48] See, for example, Dinkumware’s Abridged library at www.dinkumware.com. This library omits locale support. and exception support is optional.

[49] Vandevoorde and Josuttis, C++ Templates: The Complete Guide, Addison-Wesley, 2003.

[50] The C++ standards committee is considering relaxing the only-within-a-template rule for these disambiguation hints, and some compilers are allowing then in non-template code already.

[51] See Stroustrup, The C++ Programming Language, 3rd Edition, Addison-Wesley, pp. 335-336.

[52] Technically, comparing two pointers not inside the same array is undefined behavior, but compilers nowadays don’t complain about this. All the more reason to do it right.

[53] We are indebted to Nathan Myers for this example.

[54] Such as type information encoded in a decorated name.

[55] C++ compilers can introduce names anywhere they want, however. Fortunately, most don’t declare names they don’t need.

[56] If you’re interested in seeing the proposal, it’s Core Issue 352.

[57] A reference to the British animated short feature The Wrong Trousers by Nick Park.

[58] We discuss vector in depth in Chapter 7.

[59] Since the forwarding functions are inline, no code is generated at all!

[60] Also called Koenig lookup, after Andrew Koenig, who first proposed the technique to the C++ standards committee. ADL applies universally, whether templates are involved or not.

[61] In a talk given at The C++ Seminar, Portland, OR, September, 2001.

[62] Another template idiom, mixin inheritance, is covered in Chapter 9.

Перейти на страницу:

Похожие книги

1С: Бухгалтерия 8 с нуля
1С: Бухгалтерия 8 с нуля

Книга содержит полное описание приемов и методов работы с программой 1С:Бухгалтерия 8. Рассматривается автоматизация всех основных участков бухгалтерии: учет наличных и безналичных денежных средств, основных средств и НМА, прихода и расхода товарно-материальных ценностей, зарплаты, производства. Описано, как вводить исходные данные, заполнять справочники и каталоги, работать с первичными документами, проводить их по учету, формировать разнообразные отчеты, выводить данные на печать, настраивать программу и использовать ее сервисные функции. Каждый урок содержит подробное описание рассматриваемой темы с детальным разбором и иллюстрированием всех этапов.Для широкого круга пользователей.

Алексей Анатольевич Гладкий

Программирование, программы, базы данных / Программное обеспечение / Бухучет и аудит / Финансы и бизнес / Книги по IT / Словари и Энциклопедии
1С: Управление торговлей 8.2
1С: Управление торговлей 8.2

Современные торговые предприятия предлагают своим клиентам широчайший ассортимент товаров, который исчисляется тысячами и десятками тысяч наименований. Причем многие позиции могут реализовываться на разных условиях: предоплата, отсрочка платежи, скидка, наценка, объем партии, и т.д. Клиенты зачастую делятся на категории – VIP-клиент, обычный клиент, постоянный клиент, мелкооптовый клиент, и т.д. Товарные позиции могут комплектоваться и разукомплектовываться, многие товары подлежат обязательной сертификации и гигиеническим исследованиям, некондиционные позиции необходимо списывать, на складах периодически должна проводиться инвентаризация, каждая компания должна иметь свою маркетинговую политику и т.д., вообщем – современное торговое предприятие представляет живой организм, находящийся в постоянном движении.Очевидно, что вся эта кипучая деятельность требует автоматизации. Для решения этой задачи существуют специальные программные средства, и в этой книге мы познакомим вам с самым популярным продуктом, предназначенным для автоматизации деятельности торгового предприятия – «1С Управление торговлей», которое реализовано на новейшей технологической платформе версии 1С 8.2.

Алексей Анатольевич Гладкий

Финансы / Программирование, программы, базы данных

Все жанры