Beyond the C++ Standard Library: An Introduction to Boost [Electronic resources] نسخه متنی

This is a Digital Library

With over 100,000 free electronic resource in Persian, Arabic and English

Beyond the C++ Standard Library: An Introduction to Boost [Electronic resources] - نسخه متنی

Bjorn Karlsson

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید

Generic Programming and Template Metaprogramming


Boost.Call_traits


This library provides automatic deduction of the best way of passing arguments to functions, based upon on the argument type. For example, when passing built-in types such as int and double, it is most efficient to pass them by value. For user-defined types, passing them by reference to const is generally preferable. Call_traits automatically selects the right argument type for you. The library also helps in declaring arguments as references, without imposing restrictions or risking references to references (which are illegal in C++). Call_traits is typically used with generic functions that require the most efficient way of passing arguments without knowing much about the argument types beforehand, and to avoid the reference-to-reference problem.

The authors of Call_traits are Steve Cleary, Beman Dawes, Howard Hinnant, and John Maddock.

Boost.Concept_check


Concept_check supplies class templates that are used to test certain concepts (set of requirements). Generic (as in parameterized) code typically requires that the types with which it is instantiated model some abstraction, such as LessThanComparable. This library provides the means to explicitly state the requirements of the parameterizing types for templates. Clients of the code benefit because the requirements are documented and because the compiler can produce an error message that explicitly states how a type failed to meet them. Boost.Concept_check provides more than 30 concepts that can be used for generic code, and several archetypes that may be used to verify that component implementations include all relevant concepts. It is used to assert and document the requirements for concepts in generic code.

The author of Concept_check is Jeremy Siek, who was inspired by previous work by Alexander Stepanov and Matt Austern.

Boost.Enable_if


Enable_if allows function templates or class template specializations to include or exclude themselves from a set of matching functions or specializations. The main use cases are to include or exclude based on some property of the parameterizing typefor example, enabling a function template only when instantiated with an integral type. The library also offers a very useful studying opportunity of SFINAE (substitution failure is not an error).

The authors of Enable_if are Jaakko Järvi, Jeremiah Willcock, and Andrew Lumsdaine.

Boost.In_place_factory


The In_place_factory library is a framework for direct construction of contained objects, including variadic argument lists for initialization. This can reduce the typical requirement that contained types be CopyConstructible, and alleviates the need to create unnecessary temporaries used only for the purpose of providing a source object to be copied from. The library helps minimize the work needed to forward the arguments used for initialization of the contained object.

The author of In_place_factory is Fernando Cacciola.

Boost.Mpl


Mpl is a library for template metaprogramming. It includes data structures and algorithms that closely resemble those from the C++ Standard Library, but here they are used at compile time. There is even support for compile-time lambda expressions! Performing compile-time operations, such as generating types or manipulating sequences of types, is increasingly common in modern C++, and a library that offers such functionality is an extremely important tool. To the best of my knowledge, there is nothing quite like the Mpl library in existence. It fills an important void in the world of C++ metaprogramming. I should tell you that there's a book for Boost.Mpl in the worksby the time you read this, it will be available. C++ Template Metaprogramming is written by Aleksey Gurtovoy and David Abrahams. You'll want to get your hands on that one as soon as possible!

The author of Mpl is Aleksey Gurtovoy, with important contributions from many others.

Boost.Property_map


Property_map is a conceptual library rather than a concrete implementation. It introduces the property_map concept and a set of requirements for property_map types, thereby giving the syntactic and semantic requirements that are needed to map from a key to a value. This is useful when generic code needs to state that types must support such a mapping. C++ arrays are examples of property_maps. This library contains the definition of a concept that may be tested using Boost.Concept_check.

The author of Property_map is Jeremy Siek.

Boost.Static_assert


A common need when doing compile-time programming is to perform static assertionsthat is, compile-time assertions. Furthermore, it's nontrivial to get consistent errors, which is what static assertions must produce to signal a failed assertion, across different compilers. Static_assert provides support for static assertions at namespace, class, and function scope. Detailed information is available in "Library 3: Utility."

The author of Static_assert is Dr. John Maddock.

Boost.Type_traits


Successful generic programming often requires making decisions based upon the properties of parameterizing types or adjusting properties (for example, the cv-qualification[2]) of those types. Type_traits offers compile-time information about types, such as whether a type is a pointer or a reference, and transformations that add or remove fundamental properties of types. Type_traits has been accepted for the upcoming Library Technical Report.

[2] A type can be cv-unqualified (not const or volatile), const-qualified (const), volatile-qualified (declared volatile), or volatile-const-qualified (both const and volatile); all of these versions of a type are distinct.

The authors of Type_traits are Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant, Jesse Jones, Mat Marcus, John Maddock, and Jeremy Siek, with contributions from many others.

/ 124