Effective C + + clause 55 make yourself familiar with boost

Source: Internet
Author: User

1. Boost is a community of C + + developers and a free-to-download C + + library that has a lot of http://Boost.org.C++ organizations and websites, but boost has two features unmatched by other organizations: first, boost by C + + Standard Committee members are created, and therefore have a unique affinity with the C + + standards Committee, as a "can be added to the various functions of standard C + +" is one of the goals of boost, in fact, with TR1 (see clause 54) proposal into the standard C + + 14 new library, More than two-thirds builds on boost. Second, it is based on an open peer review (public peers review), which contributes to the blocking of inferior libraries.

2. Boost contains dozens of libraries, and there are a number of additions to it, and the boost library has a wide variety of topics, differentiated into 10 entries:

string and text processing. Overrides a type-safe (type-safe) Printf-like formatting action, a regular expression (this is the basis for TR1 similar functionality, see Clause 54), and the lexical unit cut (tokenizing) and parsing (parsing).

Container. Overrides an array of "interfaces similar to STL and fixed size", with variable size bitsets and multidimensional arrays.

function objects and advanced programming. Covering several libraries that are used as the basis for TR1 functions, including the use of LAMBDA.LAMBDA to create function objects anywhere, is not very intuitive:

using manespace boost::lambda;std::vector<int> v; // for each element of V X, print out x*2+10, where _1 is a placeholder symbol (placeholder) Std::for_each for the current element of the Lambda library(V.begin (), V.end (), std:: Cout<<_1*2+<<'\ n');

Generic Programming (Generic programming). Cover a large group of traits class, see clause 47

Template metaprogramming. Overrides a library written for compiler assertions and the Boost MPL library. MPL provides support for compiler entities (Compile-time entities) such as the stl-like data structure of types.

// Create a List-like compile-time container that holds three types: Float,double,long double and name it "floats"typedef boost::mpl::list<  Float,double,longdouble> floats; // Create a list of the types to be stored during compilation, based on the type in "floats", with int first, and the new container named Typestypedef boost::mpl::p ush_front<floats, int>::type types;

Math and values (math and Numerics). Includes rational number, eight and four (octonions and quaternions), common conventions (Divisior) and char multiple operations, random numbers, etc.

Correctness and testing. Overrides the library used to formalize the implicit template interface (implict templates interface) and programming for "test-first" programming patterns.

Data structures-covering LEEI security (Type-safe) large unions, and the tuple library.

Language support. Includes allowing seamless interoperability between C + + and Python (seamless interoperability).

Memory. Covers the pool library for efficient and block-sized allocators (see clause 50), as well as multi-variable smart pointers (smart pointers, see clause 13), including (but not just) TR1 smart pointers. Another NON-TR1 smart pointer is scoped_ Array, which is a auto_ptr-like smart pointer for dynamically allocating arrays.

Miscellaneous. Includes CRC verification, date and time processing, moving back and forth on the file system, and so on.

3. The library provided by boost is powerful, but not omnipotent, for example, it does not provide a library of programs designed for GUI development, or a library to connect to a database.

Effective C + + clause 55 make yourself familiar with boost

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.