Guide to full development of Boost Library

Source: Internet
Author: User
Tags time and date
Document directory
  • 1.1.1 what is boost
  • 1.1.3 use boost
Chapter 2 Boost library overview 1st what is Boost1.1.1 Boost

The Boost library is a powerful, well-structured, cross-platform, open-source and completely free C ++ library.

1.1.3 use Boost

The header file of the Boost Library and the common header file (*. h) or the header file of the C ++ standard library (without a suffix) is different. It puts the C ++ class declaration and implementation in one file instead of two files, that is, ". h +. cpp ", so the file suffix is. hpp.

Of course, there is a reason for doing so. First, it is connected to the common C header file (*. h) differentiation. Another important reason is that the Boost library can be compiled directly by introducing the programmer's work without advance compilation. This facilitates the use of the library. The last (helpless) reason is the limitation of the C ++ compiler. Many compilers do not yet support the export mode of the template proposed by the c ++ standard ), A large number of templates are used in the Boost library, which has to be used to maintain compatibility with various compilers. hpp header file format.

1.2 about STLport1.2.1 what is STLport

STLport is a free C ++ standard library implementation that fully complies with the C ++ 98 standard (and revised in 2003. STLport has many advantages that cannot be implemented by STL. The first is high portability. It can be used with almost all operating systems and compilers on the market, so that the developed programs can achieve consistent standard library implementation on different compilation platforms. The second is the excellent performance. Its original version SGISTL is famous for its high efficiency. STLport especially focuses on performance and efficiency during transplantation, and 100% fully complies with the C ++ Standard Specification. The third advantage is the addition of some useful extensions outside the standard, such as rope (enhanced string class), slist (single-chain table data structure), hash_map (hash ing container ), and supports thread security.

Chapter 2 Overview of time and date 2nd timer Database

Timer is a small library that provides simple time and progress display functions. It can be used for performance testing and other tasks that require timing. It is sufficient for most cases.

Timer is not suitable for high-precision time measurement tasks. Its accuracy depends on the operating system or compiler, and it is difficult to achieve cross-platform performance. Timer is not suitable for the measurement of a long time period. The maximum time span is only several hundred hours. timer cannot be used if the unit of time is day, month, or year, switch to the date_time database.

2.3 progress_timer

Progress_timer is also a timer, which inherits from timer and automatically outputs the time during the analysis, saving timer's Manual call to elapsed (). It is a handy tool for automatic timing. As long as the progress_timer object is declared, the time elapsed will be automatically output during object analysis. If you want to measure multiple times in a program, you can use braces {} to limit the life cycle of progress_timer.

2.4 progress_display

Progress_display can display the progress of the program execution on the console. If the program execution is time consuming, it can provide a friendly user interface, this prevents users from losing patience while waiting, and even wondering if the program is running properly.

Chapter 2 Memory Management 3rd smart_ptr library Overview

There are many Chinese sources in computer systems. memory is the most common among us. In addition, there are file descriptors, sockets, operating system handle, database connections, and so on, after applying for these resources in the program, the system must be promptly returned; otherwise, unpredictable consequences will occur.

Improper use of new, delete, and pointer is the root cause of resource acquisition/release problems in C ++, correct and wise use of Delete is the key to distinguishing beginners and skilled users in C ++ (a common practice is to call Delete before each return statement that leaves the scope, and use try to capture all possible exceptions, and then call Delete in the Catch Block ).


Chapter 2 container and Data Structure

Containers are the most noticeable part in STL. vector, deque, list, set, and map implement the most commonly used dynamic arrays (vectors), double-end queue, two-way linked list, set and ing five data structures.


Chapter 2 mathematics and numbers

From the perspective of pure mathematics, the program is just a very large integer.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.