Boost C++ Libraries

Boost C++ Libraries

infobox software
name = Boost C++ Libraries


caption = Boost logo
latest_release_version = 1.36.0
latest_release_date = 14 August 2008
genre = Libraries
license = [http://www.boost.org/LICENSE_1_0.txt Boost Software License]
website = http://www.boost.org/

The Boost C++ Libraries are a collection of peer-reviewed, open source libraries that extend the functionality of C++. Most of the libraries are licensed under the Boost Software License, designed to allow Boost to be used with both open and closed source projects. Many of Boost's founders are on the C++ standard committee and several Boost libraries have been accepted for incorporation into the Technical Report 1 of C++0x. [ [http://www.open-std.org/jtc1/sc22/wg21/docs/library_technical_report.html Library Technical Report ] ]

The libraries are aimed at a wide range of C++ users and application domains. They range from general-purpose libraries like [http://www.boost.org/doc/libs/1_35_0/libs/smart_ptr/smart_ptr.htm the smart_ptr library] , to OS abstractions like FileSystem, to libraries primarily aimed at other library developers and advanced C++ users, like [http://www.boost.org/libs/mpl the MPL] .

In order to ensure efficiency and flexibility, Boost makes extensive use of templates. Boost has been a source of extensive work and research into generic programming and metaprogramming in C++.

Examples

The current Boost release contains 87 individual libraries,including the following three:

Linear algebra – uBLAS

Boost includes the uBLAS linear algebra library, with BLAS support for vectors and matrices.

* Example showing how to multiply a vector with a matrix:
#include
#include
#include
#include

using namespace boost::numeric::ublas;

/* "y = Ax" example */int main () { vector x (2); x(0) = 1; x(1) = 2; matrix A(2,2); A(0,0) = 0; A(0,1) = 1; A(1,0) = 2; A(1,1) = 3;

vector y = prod(A, x);

std::cout << y << std::endl; return 0;}

Generating random numbers – Boost.Random

Boost provides distribution-independent pseudorandom number generators and PRNG-independent probability distributions, which are combined to build a concrete generator.
* Example showing how to sample from a normal distribution using the Mersenne Twister generator:
#include
#include

using namespace boost;

double SampleNormal (double mean, double sigma){ // Create a Mersenne twister random number generator // that is seeded once with #seconds since 1970 static mt19937 rng(static_cast (std::time(0)));

// select Gaussian probability distribution normal_distribution norm_dist(mean, sigma);

// bind random number generator to distribution, forming a function variate_generator > normal_sampler(rng, norm_dist);

// sample from the distribution return normal_sampler();}See [http://boost.org/libs/random/ Boost Random Number Library] for more details.

Multithreading – Boost.Thread

Example code that demonstrates creation of threads:
#include
#include

using namespace std;

void hello_world() { cout << "Hello world, I'm a thread!" << endl;}

int main(int argc, char* argv [] ) { // start a new thread that calls the "hello_world" function boost::thread my_thread(&hello_world); // wait for the thread to finish my_thread.join(); return 0;}

* [http://www.ddj.com/dept/cpp/184401518 Introduction to Boost.Threads] in Dr. Dobb's Journal. (2002)
* Boost.Threads [http://www.boost.org/doc/html/thread.html API reference] .
* [http://threadpool.sourceforge.net threadpool library] based on Boost.Thread

Associated people

Original founders of Boost still active in the community include Beman Dawes and David Abrahams. Author of several books on C++, Nicolai Josuttis contributed the Boost array library in 2001. Around 3,000 people are subscribed to Boost mail-list and dozens of them are very active (as of 2007).

See also

* Jam — Boost includes a package called Boost.Build, which uses a special version of Perforce Jam called Boost.Jam

References

External links

* [http://boost.org/ Boost Homepage]
* [http://www.codeproject.com/vcpp/stl/boostsmartptr.asp Smart Pointers to boost your code]
* [http://shoddykid.blogspot.com/2008/07/getting-started-with-boost.html Building Boost libraries]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Boost C++ Libraries — Boost Boost C++ Libraries Développeur Développeurs bénévoles Dernière version 1.39.0 (le …   Wikipédia en Français

  • Boost (C++-Bibliothek) — Boost C++ Libraries Aktuelle Version 1.47.0[1] (11. Juli 2011) Betriebssystem portabel (u. a. UNIX, GNU/Linux …   Deutsch Wikipedia

  • Boost — can refer to: NOTOC cience, technology and mathematics* Automotive: ** Boost, positive manifold pressure in cars, see turbocharger#Boost threshold. *** a loose term for turbo or supercharger ** A slang term meaning to start a vehicle, see jump… …   Wikipedia

  • Boost (librairie C++) — Boost Boost C++ Libraries Développeur Développeurs bénévoles Dernière version 1.39.0 (le …   Wikipédia en Français

  • Boost — C++ Libraries Développeur Communauté de Boost Dernière version …   Wikipédia en Français

  • Boost Software License — The Boost Software License is an open source license used by the Boost C++ Libraries. It is also a popular license for a significant number of other open source C++ projects. It is a permissive license in the style of the popular BSD license and… …   Wikipedia

  • Biblioteca Boost — Saltar a navegación, búsqueda Boost C++ Libraries www.boost.org Información general Última ver …   Wikipedia Español

  • List of multi-threading libraries — List of cross platform multi threading libraries for the c++ programming language.* Boost C++ Libraries * OpenMP * OpenThreads * POCO Thread (part of POCO project http://pocoproject.org/poco/info/index.html ) * Zthread * Intel Threading Building… …   Wikipedia

  • Библиотека Boost — Boost Тип библиотека (программирование) Написана на С++ ОС Кроссплатформенный Версия Boost 1.39.0 02.05.2009 …   Википедия

  • Strengthening Kids’ Interest in Learning and Libraries Act — The Strengthening Kids’ Interest in Learning and Libraries Act or SKILLS Act is proposed legislation introduced in the United States Congress.On June 26, 2007, Senators Jack Reed of Rhode Island and Thad Cochran of Mississippi introduced… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”