Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Boost Macro Reference

Boost , Boost.Config , Boost.Config

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Следующие макросы описывают функции, требуемые стандартом C++03, если определен один из следующих макросов, то он представляет собой дефект в соответствии компилятора со стандартом 2003 года.

Макро

Раздел

Описание

BOOST_BCB_PARTIAL_SPECIALIZATION_BUG

Compiler

The compiler exhibits certain partial specialisation bug - probably Borland C++ Builder specific.

<BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL>

Compiler

Argument dependent lookup fails if there is a using declaration for the symbol being looked up in the current scope. For example, using boost::get_pointer; prevents ADL from finding overloads of get_pointer in namespaces nested inside boost (but not elsewhere). Probably Borland specific.

BOOST_NO_ADL_BARRIER

Compiler

The compiler locates and searches namespaces that it should *not* in fact search when performing argument dependent lookup.

BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP

Compiler

Компилятор не осуществляет поиск, зависящий от аргументов (также называемый поиском Koenig); см. std::3.4.2 [basic.koenig.lookup]

BOOST_NO_AUTO_PTR

Standard library

If the compiler / library supplies non-standard or broken std::auto_ptr.

BOOST_NO_COMPLETE_VALUE_INITIALIZATION

Compiler

Compiler has not completely implemented value-initialization. See also The Utility/Value Init docs

<BOOST_NO_CTYPE_FUNCTIONS>

Platform

Платформа не предоставляет функции для операций классификации символов<<ctype.h>>и<<cctype>>, только макросы.

BOOST_NO_CV_SPECIALIZATIONS

Compiler

If template specialisations for cv-qualified types conflict with a specialisation for a cv-unqualififed type.

BOOST_NO_CV_VOID_SPECIALIZATIONS

Compiler

Если шаблонные специализации для типов cv-void противоречат специализации для пустоты.

BOOST_NO_CWCHAR

Platform

Платформа не предоставляет<<wchar.h>>и<<cwchar>>.

BOOST_NO_CWCTYPE

Platform

The Platform does not provide <wctype.h> and <cwctype>.

<BOOST_NO_FENV_H>

Platform, Standard library

The C standard library doesn't provide <fenv.h>. <boost/detail/fenv.hpp> should be included instead of <fenv.h> for maximum portability on platforms which do provide <fenv.h>.

<BOOST_NO_DEPENDENT_NESTED_DERIVATIONS>

Compiler

The compiler fails to compile a nested class that has a dependent base class:

template<typename T>
struct foo : {
   template<typename U>
   struct bar : public U {};

};

<BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS>

Compiler

Template value parameters cannot have a dependent type, for example:

template<class T, typename T::type value>
class X { ... };

BOOST_NO_EXCEPTION_STD_NAMESPACE

Standard Library

Стандартная библиотека не помещает некоторые или все содержимое<<exception>>в пространство имен std.

BOOST_NO_EXCEPTIONS

Compiler

Компилятор не поддерживает обработку исключений (эта настройка обычно требуется многими компиляторами C++ для встроенных платформ). Обратите внимание, что нет необходимости в том, чтобы библиотеки бустеров соблюдали эту настройку конфигурации - в некоторых случаях это может быть невозможно. Библиотеки, которые чтят это, как правило, прекратят, если произойдет критическая ошибка - вы были предупреждены!

<BOOST_NO_FUNCTION_TEMPLATE_ORDERING>

Compiler

Компилятор не выполняет упорядочение шаблонов функций или его упорядочение шаблонов функций является неправильным.

<
// #1
template<classT>voidf(T);
// #2
template<classT,classU>voidf(T(*)(U));
voidbar(int);
f(&bar);// should choose #2.
>

BOOST_NO_INCLASS_MEMBER_INITIALIZATION

Compiler

Compiler violates std::9.4.2/4.

BOOST_NO_INTRINSIC_WCHAR_T

Compiler

The C++ implementation does not provide wchar_t, or it is really a synonym for another integral type. Use this symbol to decide whether it is appropriate to explicitly specialize a template on wchar_t if there is already a specialization for other integer types.

<BOOST_NO_IOSFWD>

std lib

The standard library lacks <iosfwd>.

<BOOST_NO_IOSTREAM>

std lib

В стандартной библиотеке отсутствуют<<iostream>>,<<istream>>или<<ostream>>.

<BOOST_NO_IS_ABSTRACT>

Compiler

Компилятор C++ не поддерживает SFINAE с абстрактными типами, это охваченоCore Language DR337, но не является частью текущего стандарта. К счастью, большинство компиляторов, поддерживающих SFINAE, также поддерживают этот DR.

BOOST_NO_LIMITS

Standard library

Реализация C++ не обеспечивает заголовок<<limits>>. Никогда не проверяйте этот символ в библиотечном коде; всегда включайте<<boost/limits.hpp>>, что гарантирует предоставление<std::numeric_limits>.

BOOST_NO_CXX11_NUMERIC_LIMITS

Standard library

C++11 additions to std::numeric_limits are not available for use. static function numeric_limits<T>::lowest() the lowest finite value representable by the numeric type. static int const max_digits10 the number of decimal digits that are required to make sure that two distinct values of the type have distinct decimal representations. template<> class numeric_limits<char16_t>;, see also BOOST_NO_CXX11_CHAR16_T, template<> class numeric_limits<char32_t>; see also BOOST_NO_CXX11_CHAR32_T. Replaces BOOST_NO_NUMERIC_LIMITS_LOWEST.

<BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS>

Standard library

Constants such as numeric_limits<T>::is_signed are not available for use at compile-time.

BOOST_NO_LONG_LONG_NUMERIC_LIMITS

Standard library

There is no specialization for numeric_limits<long long> and numeric_limits<unsigned long long>. <boost/limits.hpp> will then add these specializations as a standard library "fix" only if the compiler supports the long long datatype.

BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS

Compiler

The compiler does not support the specialization of individual member functions of template classes.

BOOST_NO_MEMBER_TEMPLATE_KEYWORD

Compiler

If the compiler supports member templates, but not the template keyword when accessing member template classes.

<BOOST_NO_MEMBER_TEMPLATE_FRIENDS>

Compiler

Member template friend syntax (template<class P> friend class frd;) described in the C++ Standard, 14.5.3, not supported.

<BOOST_NO_MEMBER_TEMPLATES>

Compiler

Member template functions not fully supported.

BOOST_NO_MS_INT64_NUMERIC_LIMITS

Standard library

There is no specialization for numeric_limits<__int64> and numeric_limits<unsigned __int64>. <boost/limits.hpp> will then add these specializations as a standard library "fix", only if the compiler supports the __int64 datatype.

<BOOST_NO_NESTED_FRIENDSHIP>

Compiler

Компилятор не позволяет вложенному классу получить доступ к частным членам содержащего его класса. Возможно, Borland/CodeGear.

BOOST_NO_OPERATORS_IN_NAMESPACE

Compiler

Компилятор требует, чтобы унаследованные функции друга оператора определялись в области пространства имен, а затем использовались для повышения. Возможно, GCC.<<boost/operators.hpp>>, например.

<BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS>

Compiler

Компилятор неправильно обрабатывает частичные специализации, которые зависят от аргументов по умолчанию в первичном шаблоне.

<BOOST_NO_POINTER_TO_MEMBER_CONST>

Compiler

Компилятор неправильно обрабатывает указатели на функции const-члена, предотвращая их использование в перегруженных шаблонах функций. См.<<boost/functional.hpp>>, например.

<BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS>

Compiler

Указатели для членов не работают при использовании в качестве параметров шаблона.

<BOOST_NO_PRIVATE_IN_AGGREGATE>

Compiler

The compiler misreads 8.5.1, treating classes as non-aggregate if they contain private or protected member functions.

BOOST_NO_RTTI

Compiler

The compiler may (or may not) have the typeid operator, but RTTI on the dynamic type of an object is not supported.

BOOST_NO_SFINAE

Compiler

The compiler does not support the "Substitution Failure Is Not An Error" meta-programming idiom.

BOOST_NO_SFINAE_EXPR

Compiler

The compiler does not support usage of SFINAE with arbitrary expressions.

<BOOST_NO_STD_ALLOCATOR>

Standard library

The C++ standard library does not provide a standards conforming std::allocator.

<BOOST_NO_STD_DISTANCE>

Standard library

Платформа не имеет соответствующей версии<std::distance>

.

BOOST_NO_STD_ITERATOR

Standard library

Реализация C++ не обеспечивает класс<std::iterator>.

BOOST_NO_STD_ITERATOR_TRAITS

Standard library

The compiler does not provide a standard compliant implementation of std::iterator_traits. Note that the compiler may still have a non-standard implementation.

BOOST_NO_STD_LOCALE

Standard library

The standard library lacks std::locale.

BOOST_NO_STD_MESSAGES

Standard library

The standard library lacks a conforming std::messages facet.

<BOOST_NO_STD_MIN_MAX>

Standard library

Стандартная библиотека C++ не предоставляет функции шаблонов<min()>и<max()>, которые должны быть в<<algorithm>>.

<BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN>

Standard library

Defined if the standard library's output iterators are not assignable.

BOOST_NO_STD_TYPEINFO

Standard library

The <typeinfo> header declares type_info in the global namespace instead of namespace std.

<BOOST_NO_STD_USE_FACET>

Standard library

В стандартной библиотеке отсутствует соответствующая<std::use_facet>

.

<BOOST_NO_STD_WSTREAMBUF>

Standard library

The standard library's implementation of std::basic_streambuf<wchar_t> is either missing, incomplete, or buggy.

<BOOST_NO_STD_WSTRING>

Standard library

The standard library lacks std::wstring.

<BOOST_NO_STDC_NAMESPACE>

Compiler, Platform

The contents of C++ standard headers for C library functions (the <c...> headers) have not been placed in namespace std. This test is difficult - some libraries "fake" the std C functions by adding using declarations to import them into namespace std, unfortunately they don't necessarily catch all of them...

BOOST_NO_STRINGSTREAM

Standard library

The C++ implementation does not provide the <sstream> header.

<BOOST_NO_SWPRINTF>

Platform

The platform does not have a conforming version of swprintf.

BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

Compiler

Class template partial specialization (14.5.4 [temp.class.spec]) not supported.

<BOOST_NO_TEMPLATED_IOSTREAMS>

Standard library

The standard library does not provide templated iostream classes.

BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS

Standard library

The standard library does not provide templated iterator constructors for its containers.

<BOOST_NO_TEMPLATE_TEMPLATES>

Compiler

The compiler does not support template template parameters.

<BOOST_NO_TYPEID>

Compiler

Компилятор вообще не поддерживает оператора Typeid.

BOOST_NO_TYPENAME_WITH_CTOR

Compiler

The typename keyword cannot be used when creating a temporary of a Dependent type.

BOOST_NO_UNREACHABLE_RETURN_DETECTION

Compiler

Если возврат недостижим, то не требуется никакого заявления о возврате, однако некоторые компиляторы настаивают на этом, в то время как другие выдают кучу предупреждений, если он действительно присутствует.

BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE

Compiler

The compiler will not accept a using declaration that brings a function from a typename used as a base class into a derived class if functions of the same name are present in the derived class.

BOOST_NO_USING_TEMPLATE

Compiler

The compiler will not accept a using declaration that imports a template class or function from another namespace. Originally a Borland specific problem with imports to/from the global namespace, extended to MSVC6 which has a specific issue with importing template classes (but not functions).

<BOOST_NO_VOID_RETURNS>

Compiler

Компилятор не позволяет функции пустоты возвращать результат вызова другой функции пустоты.

<
voidf(){}
voidg(){returnf();}
>

Следующие макросы описывают функции, которые не требуются стандартом C++. Макрос определяется только при наличии функции.

Макро

Раздел

Описание

BOOST_HAS_BETHREADS

Platform

Платформа поддерживает потоки в стиле BeOS.

BOOST_HAS_CLOCK_GETTIME

Platform

The platform has the POSIX API clock_gettime.

BOOST_HAS_DIRENT_H

Platform

Платформа имеет заголовок POSIX<<dirent.h>>

.

BOOST_HAS_EXPM1

Platform

The platform has the functions expm1, expm1f and expm1l in <math.h>

<BOOST_HAS_FLOAT128>

Compiler

The compiler has __float128 as a native type which is distinct from all the regular C++ floating point types.

BOOST_HAS_FTIME

Platform

The platform has the Win32 API type FTIME.

<BOOST_HAS_GETSYSTEMTIMEASFILETIME>

Platform

Платформа имеет API Win32 GetSystemTimeAsFileTime.

<BOOST_HAS_GETTIMEOFDAY>

Platform

The platform has the POSIX API gettimeofday.

BOOST_HAS_HASH

Standard library

The C++ implementation provides the (SGI) hash_set and hash_map classes. When defined, BOOST_HASH_SET_HEADER and BOOST_HASH_LIST_HEADER will contain the names of the header needed to access hash_set and hash_map; BOOST_STD_EXTENSION_NAMESPACE will provide the namespace in which the two class templates reside.

<BOOST_HAS_INT128>

Compiler

The compiler has __int128 and unsigned __int128 as native types which are distinct from all the regular C++ integer types.

BOOST_HAS_LOG1P

Platform

Платформа имеет функции<log1p>,<log1pf>и<log1pl>в<<math.h>>.

BOOST_HAS_MACRO_USE_FACET

Standard library

The standard library lacks a conforming std::use_facet, but has a macro _USE(loc, Type) that does the job. This is primarily for the Dinkumware std lib.

<BOOST_HAS_MS_INT64>

Compiler

The compiler supports the __int64 data type.

<BOOST_HAS_NANOSLEEP>

Platform

The platform has the POSIX API nanosleep.

BOOST_HAS_NL_TYPES_H

Platform

Платформа имеет<<nl_types.h>>

.

BOOST_HAS_NRVO

Compiler

Указывается, что компилятор поддерживает названную оптимизацию обратных значений (NRVO). Используется для выбора наиболее эффективной реализации для некоторых функций. Например,<<boost/operators.hpp>>.

BOOST_HAS_PARTIAL_STD_ALLOCATOR

Standard Library

Стандартная библиотека имеет частично соответствующий<std::allocator>класс, но без каких-либо шаблонов членов.

BOOST_HAS_PRAGMA_ONCE

Compiler

The compiler recognizes the #pragma once directive which tells that the containing header should be included only once while preprocessing the current translation unit. The pragma may improve compile times of large projects with some compilers.

<BOOST_HAS_PRAGMA_DETECT_MISMATCH>

Compiler

Компилятор распознает директиву<#pragma detect_mismatch("name", "value")>, которая сообщает, что этап связи должен быть завершен с ошибкой, если значения для предусмотренного<"name">несоответствия. Эта прагма может помочь предотвратить нарушения ODR и обеспечить компиляцию различных модулей с одинаковыми флагами.

<BOOST_HAS_PTHREAD_DELAY_NP>

Platform

The platform has the POSIX API pthread_delay_np.

BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE

Platform

Платформа имеет POSIX API<pthread_mutexattr_settype>.

BOOST_HAS_PTHREAD_YIELD

Platform

The platform has the POSIX API pthread_yield.

<BOOST_HAS_PTHREADS>

Platform

Платформа поддерживает потоки в стиле POSIX.

BOOST_HAS_SCHED_YIELD

Platform

The platform has the POSIX API sched_yield.

BOOST_HAS_SGI_TYPE_TRAITS

Компилятор, стандартная библиотека

The compiler has native support for SGI style type traits.

BOOST_HAS_STDINT_H

Platform

The platform has a <stdint.h>

BOOST_HAS_SLIST

Standard library

Реализация C++ обеспечивает класс списков (SGI). При определении<BOOST_SLIST_HEADER>будет содержать имя заголовка, необходимого для доступа<slist>, а<BOOST_STD_EXTENSION_NAMESPACE>обеспечит пространство имен, в котором<slist>находится.

BOOST_HAS_STLP_USE_FACET

Standard library

The standard library lacks a conforming std::use_facet, but has a workaround class-version that does the job. This is primarily for the STLport std lib.

BOOST_HAS_TR1_ARRAY

Standard library

The library has a TR1 conforming version of <array>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_ARRAY.

BOOST_HAS_TR1_COMPLEX_OVERLOADS

Standard library

The library has a version of <complex> that supports passing scalars to the complex number algorithms.

<BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG>

Standard library

The library has a version of <complex> that includes the new inverse trig functions from TR1.

<BOOST_HAS_TR1_REFERENCE_WRAPPER>

Standard library

The library has TR1 conforming reference wrappers in <functional>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.

BOOST_HAS_TR1_RESULT_OF

Standard library

The library has a TR1 conforming result_of template in <functional>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.

BOOST_HAS_TR1_MEM_FN

Standard library

The library has a TR1 conforming mem_fn function template in <functional>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.

BOOST_HAS_TR1_BIND

Standard library

The library has a TR1 conforming bind function template in <functional>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.

<BOOST_HAS_TR1_FUNCTION>

Standard library

Библиотека имеет шаблон TR1 в<<functional>>. Этот макрос гарантированно будет определен только после включения одного из заголовков от Boost. TR1. Далее этот макрос теперь обесценивается в пользу BOOST_NO_CXX11_HDR_FUNCTIONAL.

<BOOST_HAS_TR1_HASH>

Standard library

The library has a TR1 conforming hash function template in <functional>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.

BOOST_HAS_TR1_SHARED_PTR

Standard library

The library has a TR1 conforming shared_ptr class template in <memory>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_SMART_PTR.

BOOST_HAS_TR1_RANDOM

Standard library

The library has a TR1 conforming version of <random>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_RANDOM.

BOOST_HAS_TR1_REGEX

Standard library

The library has a TR1 conforming version of <regex>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_REGEX.

<BOOST_HAS_TR1_TUPLE>

Standard library

The library has a TR1 conforming version of <tuple>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_TUPLE.

BOOST_HAS_TR1_TYPE_TRAITS

Standard library

Библиотека имеет TR1-конформную версию<<type_traits>>. Этот макрос гарантированно будет определен только после включения одного из заголовков от Boost. TR1. Далее этот макрос теперь обесценивается в пользу BOOST_NO_CXX11_HDR_TYPE_TRAITS.

<BOOST_HAS_TR1_UTILITY>

Standard library

Библиотека имеет дополнения TR1 к<<utility>>(трубный интерфейс к<std::pair>). Этот макрос гарантированно будет определен только после включения одного из заголовков от Boost. TR1. Далее этот макрос теперь обесценивается в пользу BOOST_NO_CXX11_HDR_TUPLE.

BOOST_HAS_TR1_UNORDERED_MAP

Standard library

Библиотека имеет TR1-конформную версию<<unordered_map>>. Этот макрос гарантированно будет определен только после включения одного из заголовков от Boost. TR1. Далее этот макрос теперь обесценивается в пользу BOOST_NO_CXX11_HDR_UNORDERED_MAP.

BOOST_HAS_TR1_UNORDERED_SET

Standard library

The library has a TR1 conforming version of <unordered_set>. This macro is only guaranteed to be defined after including one of the headers from Boost.TR1. Further this macro is now deprecated in favour of BOOST_NO_CXX11_HDR_UNORDERED_SET.

BOOST_HAS_TR1

Standard library

Implies all the other BOOST_HAS_TR1_* macros should be set.

BOOST_HAS_THREADS

Платформа, компилятор

Defined if the compiler, in its current translation mode, supports multiple threads of execution.

<BOOST_HAS_TWO_ARG_USE_FACET>

Standard library

The standard library lacks a conforming std::use_facet, but has a two argument version that does the job. This is primarily for the Rogue Wave std lib.

BOOST_HAS_UNISTD_H

Platform

The Platform provides <unistd.h>.

BOOST_HAS_WINTHREADS

Platform

The platform supports MS Windows style threads.

<BOOST_MSVC_STD_ITERATOR>

Standard library

Microsoft's broken version of std::iterator is being used. This implies that std::iterator takes no more than two template parameters.

BOOST_MSVC6_MEMBER_TEMPLATES

Compiler

Microsoft Visual C++ 6.0 имеет достаточно шаблонных идиосинкразий (быть вежливым), которые<BOOST_NO_MEMBER_TEMPLATES>определены для этого компилятора.<BOOST_MSVC6_MEMBER_TEMPLATES>определено, чтобы позволить компилятору определенные обходные пути. Этот макрос определяется автоматически, если<BOOST_NO_MEMBER_TEMPLATES>не определен - другими словами, это рассматривается как строгое подмножество функций, требуемых стандартом.

BOOST_HAS_STDINT_H

Platform

There are no 1998 C++ Standard headers <stdint.h> or <cstdint>, although the 1999 C Standard does include <stdint.h>. If <stdint.h> is present, <boost/stdint.h> can make good use of it, so a flag is supplied (signalling presence; thus the default is not present, conforming to the current C++ standard).

Следующие макросы описывают функции, которые могут быть включены в будущий стандарт ISO C++, но еще не одобрены для включения в язык.

Макро

Описание

<BOOST_HAS_CONCEPTS>

The compiler supports concepts.

Следующие макросы описывают функции стандарта ISO C++ 2011 года, ранее известного как C++0x, которые еще не поддерживаются конкретным компилятором или библиотекой.

Макро

Описание

<BOOST_NO_CXX11_ADDRESSOF>

The standard library header <memory> has no working std::addressof.

<BOOST_NO_CXX11_ALIGNAS>

Компилятор не поддерживает ключевое слово<alignas>.

<BOOST_NO_CXX11_ALLOCATOR>

The standard library does not provide a C++11 version of std::allocator in <memory>.

<BOOST_NO_CXX11_ATOMIC_SMART_PTR>

The standard library <memory> does not support atomic smart pointer operations.

<BOOST_NO_CXX11_AUTO_DECLARATIONS>

The compiler does not support type deduction for variables declared with the auto keyword (auto var = ...;).

<BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS>

Компилятор не поддерживает вычет типа для нескольких переменных, объявленных ключевым словом<auto><autovar =..., *ptr =...;>

.

BOOST_NO_CXX11_CHAR16_T

The compiler does not support type char16_t.

<BOOST_NO_CXX11_CHAR32_T>

The compiler does not support type char32_t.

<BOOST_NO_CXX11_CONSTEXPR>

The compiler does not support constexpr.

BOOST_NO_CXX11_DECLTYPE

The compiler does not support decltype.

BOOST_NO_CXX11_DECLTYPE_N3276

Компилятор не поддерживает расширение до<decltype>, описанное вN3276, принятое в Мадриде, март 2011 года.

BOOST_NO_CXX11_DELETED_FUNCTIONS

Компилятор не поддерживает удаленные (<= delete>) функции.

BOOST_NO_CXX11_DEFAULTED_FUNCTIONS

The compiler does not support defaulted (= default) functions.

BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS

Компилятор не поддерживает явных операторов преобразования<explicitoperator T()>

.

BOOST_NO_CXX11_EXTERN_TEMPLATE

The compiler does not support explicit instantiation forward declarations for templates (extern template ...).

<BOOST_NO_CXX11_FINAL>

Компилятор не поддерживает финал класс-вирт-спецификатора C++.

<BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS>

Компилятор не поддерживает расширение вариадного пакета параметров шаблона в шаблон, содержащий один или несколько фиксированных аргументов

.

<BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS>

The compiler does not support default template arguments for function templates.

<BOOST_NO_CXX11_HDR_ATOMIC>

The standard library does not provide header <atomic>.

<BOOST_NO_CXX11_HDR_ARRAY>

The standard library does not provide header <array>.

BOOST_NO_CXX11_HDR_CHRONO

The standard library does not provide header <chrono>.

<BOOST_NO_CXX11_HDR_CODECVT>

Стандартная библиотека не предоставляет заголовок.

BOOST_NO_CXX11_HDR_CONDITION_VARIABLE

The standard library does not provide header <condition_variable>.

<BOOST_NO_CXX11_HDR_FORWARD_LIST>

The standard library does not provide header <forward_list>.

<BOOST_NO_CXX11_HDR_FUNCTIONAL>

Стандартная библиотека не предоставляет совместимую с C++11 версию.

BOOST_NO_CXX11_HDR_FUTURE

Стандартная библиотека не содержит заголовка.

<BOOST_NO_CXX11_HDR_INITIALIZER_LIST>

The standard library does not provide header <initializer_list>.

<BOOST_NO_CXX11_HDR_MUTEX>

Стандартная библиотека не содержит заголовка.

BOOST_NO_CXX11_HDR_RANDOM

The standard library does not provide header <random>.

BOOST_NO_CXX11_HDR_RATIO

The standard library does not provide header <ratio>.

<BOOST_NO_CXX11_HDR_REGEX>

The standard library does not provide header <regex>.

BOOST_NO_CXX11_HDR_SYSTEM_ERROR

The standard library does not provide header <system_error>.

<BOOST_NO_CXX11_HDR_THREAD>

The standard library does not provide header <thread>.

BOOST_NO_CXX11_HDR_TUPLE

The standard library does not provide header <tuple>.

BOOST_NO_CXX11_HDR_TYPEINDEX

Стандартная библиотека не содержит заголовка.

BOOST_NO_CXX11_HDR_TYPE_TRAITS

The standard library does not provide header <type_traits>.

<BOOST_NO_CXX11_HDR_UNORDERED_MAP>

Стандартная библиотека не предоставляет заголовок.

<BOOST_NO_CXX11_HDR_UNORDERED_SET>

The standard library does not provide header <unordered_set>.

BOOST_NO_CXX11_INLINE_NAMESPACES

The compiler does not support inline namespaces.

<BOOST_NO_CXX11_LAMBDAS>

Компилятор не поддерживает Lambdas.

BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS

Компилятор не позволяет передавать локальные классы в качестве параметров шаблона (этот макрос намеренно не контролирует прохождение неназванных типов в качестве параметров шаблона, см. такжеN2657).

BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS

The compiler does not support defaulted (= default) functions in access control sections other than public. Public defaulted functions may still be supported, as indicated by BOOST_NO_CXX11_DEFAULTED_FUNCTIONS. Some compilers implementing an early draft of the C++11 standard (in particular, incorporating DR906) are susceptible to this problem.

BOOST_NO_CXX11_NOEXCEPT

The compiler does not support noexcept.

BOOST_NO_CXX11_NULLPTR

Компилятор не поддерживает<nullptr>

.

BOOST_NO_CXX11_NUMERIC_LIMITS

Заголовок стандартной библиотеки<<limits>>не поддерживает версию C++11<numeric_limits>.

<BOOST_NO_CXX11_RANGE_BASED_FOR>

Компилятор не поддерживает заявления на основе диапазона.

BOOST_NO_CXX11_RAW_LITERALS

The compiler does not support raw string literals.

BOOST_NO_CXX11_REF_QUALIFIERS

The compiler does not support ref-qualifiers on member functions as described in N2439.

<BOOST_NO_CXX11_RVALUE_REFERENCES>

The compiler does not support r-value references.

BOOST_NO_CXX11_SCOPED_ENUMS

The compiler does not support scoped enumerations (enum class).

BOOST_NO_CXX11_SMART_PTR

Стандартный заголовок библиотекине имеет shareed_ptr и unique_ptr.

BOOST_NO_CXX11_STATIC_ASSERT

The compiler does not support static_assert.

BOOST_NO_CXX11_STD_ALIGN

Стандартный заголовок библиотекине имеет рабочего std::align.

BOOST_NO_CXX11_STD_UNORDERED

The standard library does not support <unordered_map> and <unordered_set>.

<BOOST_NO_CXX11_TEMPLATE_ALIASES>

The compiler does not support template aliases.

<BOOST_NO_CXX11_THREAD_LOCAL>

The compiler does not support the thread_local storage specifier.

BOOST_NO_CXX11_TRAILING_RESULT_TYPES

The compiler does not support the new function result type specification syntax (e.g. auto foo(T) -> T;).

<BOOST_NO_CXX11_UNICODE_LITERALS>

The compiler does not support Unicode (u8, u, U) literals.

BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX

The compiler does not support the C++11 Unified Initialization Syntax.

<BOOST_NO_CXX11_USER_DEFINED_LITERALS>

The compiler does not support user defined literals.

BOOST_NO_CXX11_VARIADIC_TEMPLATES

Компилятор не поддерживает вариадные шаблоны.

<BOOST_NO_CXX11_VARIADIC_MACROS>

The compiler does not support variadic macros.

BOOST_NO_LONG_LONG

The compiler does not support long long.

Следующие макросы позволяют использовать функции C++11 даже с компиляторами, которые еще не обеспечивают совместимую поддержку C++11.

Макро

Описание

BOOST_ALIGNMENT(X), BOOST_NO_ALIGNMENT

Some compilers don't support the alignas keyword but provide other means to specify alignment (usually, through compiler-specific attributes). The macro BOOST_ALIGNMENT(X) will expand to the alignas(X) keyword if the compiler supports it or to some compiler-specific attribute to achieve the specified alignment. If no such compiler-specific attribute is known then BOOST_ALIGNMENT(X) will expand to nothing and BOOST_NO_ALIGNMENT will be defined. Unlike native alignas, X must always be a compile-time integer constant. The macro can be used to specify alignment of types and data:

struct BOOST_ALIGNMENT(16) my_data
{
    char c[16];
};
BOOST_ALIGNMENT(8) int arr[32];

BOOST_CONSTEXPR

Некоторые компиляторы не поддерживают использование<constexpr>. Этот макрос ни к чему не расширяется на этих компиляторах и<constexpr>в других местах. Например, при определении функции constexpr или конструктора заменить:

<
constexprtuple();
>

на:

<
BOOST_CONSTEXPRtuple();
>

.

BOOST_CONSTEXPR_OR_CONST

Some compilers don't support the use of constexpr. This macro expands to const on those compilers, and constexpr elsewhere. For example, when defining const expr variables replace:

static constexpr UIntType xor_mask = a;

with:

static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a;

BOOST_STATIC_CONSTEXPR

This is a shortcut for static BOOST_CONSTEXPR_OR_CONST. For example, when defining const expr variables replace:

static constexpr UIntType xor_mask = a;

with:

BOOST_STATIC_CONSTEXPR UIntType xor_mask = a;

<BOOST_DEFAULTED_FUNCTION(fun,body)>

This macro is intended to be used within a class definition in order to declare a default implementation of function fun. For the compilers that do not support C++11 defaulted functions the macro will expand into an inline function definition with the body implementation. For example:

struct my_struct
{
    BOOST_DEFAULTED_FUNCTION(my_struct(), {})
};

is equivalent to:

struct my_struct
{
    my_struct() = default;
};

or:

struct my_struct
{
    my_struct() {}
};

BOOST_DELETED_FUNCTION(fun)

This macro is intended to be used within a class definition in order to declare a deleted function fun. For the compilers that do not support C++11 deleted functions the macro will expand into a private function declaration with no definition. Since the macro may change the access mode, it is recommended to use this macro at the end of the class definition. For example:

struct noncopyable
{
    BOOST_DELETED_FUNCTION(noncopyable(noncopyable const&))
    BOOST_DELETED_FUNCTION(noncopyable& operator= (noncopyable const&))
};

is equivalent to:

struct noncopyable
{
    noncopyable(noncopyable const&) = delete;
    noncopyable& operator= (noncopyable const&) = delete;
};

or:

struct noncopyable
{
private:
    noncopyable(noncopyable const&);
    noncopyable& operator= (noncopyable const&);
};

<
BOOST_NOEXCEPT
BOOST_NOEXCEPT_OR_NOTHROW
BOOST_NOEXCEPT_IF(Predicate)
BOOST_NOEXCEPT_EXPR(Expression)
>

If BOOST_NO_CXX11_NOEXCEPT is defined (i.e. C++03 compliant compilers) these macros are defined as:

#define BOOST_NOEXCEPT
#define BOOST_NOEXCEPT_OR_NOTHROW throw()
#define BOOST_NOEXCEPT_IF(Predicate)
#define BOOST_NOEXCEPT_EXPR(Expression) false

If BOOST_NO_CXX11_NOEXCEPT is not defined (i.e. C++11 compliant compilers) they are defined as:

#define BOOST_NOEXCEPT noexcept
#define BOOST_NOEXCEPT_OR_NOTHROW noexcept
#define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
#define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression))

BOOST_MSVC_ENABLE_2012_NOV_CTP

Для Microsoft Visual C++ 2012 включите функции C++11, предоставленные в ноябре 2012 года Community Technology Preview. Эти функции не включаются автоматически, поскольку CTP не поддерживает альфа-код, который не рекомендуется для использования в производстве. Этот макрос должен быть определен перед включением любых заголовков Boost и должен быть определен для всех блоков перевода в программе, включая сборки библиотеки Boost. Этот макрос больше не будет иметь никакого эффекта, как только официальная версия Microsoft будет поддерживать функции CTP.

Следующие макросы описывают функции стандарта ISO C++ 2014 года, ранее известного как C++0y, которые еще не поддерживаются конкретным компилятором или библиотекой.

Макро

Описание

BOOST_NO_CXX14_AGGREGATE_NSDMI

The compiler does not support member initializer for aggregates as in the following example:

struct Foo
{
  int x, y = 42;
};
Foo foo = { 0 };

BOOST_NO_CXX14_BINARY_LITERALS

The compiler does not binary literals (e.g. 0b1010).

<BOOST_NO_CXX14_CONSTEXPR>

The compiler does not support relaxed constexpr.

BOOST_NO_CXX14_DECLTYPE_AUTO

The compiler does not support decltype(auto).

<BOOST_NO_CXX14_DIGIT_SEPARATORS>

The compiler does not support digit separators (e.g. 1'000'000).

BOOST_NO_CXX14_GENERIC_LAMBDAS

Компилятор не поддерживает общую лямбду (например,<[](auto v){ }>).

<BOOST_NO_CXX14_HDR_SHARED_MUTEX>

The standard library does not provide header <shared_mutex>.

BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES

Компилятор не поддерживает инициализированный захват лямбды (например,<[foo =42]{}>).

BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION

Компилятор не поддерживает вычет типа возврата для нормальных функций (например,<autof() {return val; }>).

BOOST_NO_CXX14_VARIABLE_TEMPLATES

Компилятор не поддерживает шаблон переменных (например,<template<classT>T kibi= T(1024);>).

Следующие макросы позволяют использовать функции C++14 даже с компиляторами, которые еще не обеспечивают совместимую поддержку C++14.

Макро

Описание

<BOOST_CXX14_CONSTEXPR>

Этот макрос работает аналогично BOOST_CONSTEXPR, но расширяется до<constexpr>только в том случае, если доступен C++14 «расслабленный»<constexpr>.

Следующие макросы являются либо простыми помощниками, либо макросами, которые обеспечивают обходные пути для дефектов компилятора / стандартной библиотеки.

Макро

Описание

<BOOST_WORKAROUND>

Этот макрос используется в тех случаях, когда требуется специальный обходной путь компилятора, который не описывается другим Boost. Настройка макросов. Для использования макроса необходимо сначала использовать

<
#include<boost/detail/workaround.hpp>
>

:

<
#ifBOOST_WORKAROUND(MACRONAME,CONDITION)
  // workaround code goes here...
#else
  // Standard conforming code goes here...
#endif
>

, где<MACRONAME>является макросом, который обычно описывает номер версии для тестирования, и<CONDITION>является оператором сравнения, за которым следует значение. Например,<BOOST_WORKAROUND(BOOST_INTEL, <=1010)>будет оцениваться до<1>для Intel C++ 10.1 и выше.

Макрос также может быть использован с<BOOST_TESTED_AT>, если все текущие версии компилятора показывают проблему, но проблема, как ожидается, будет исправлена в какой-то более поздний момент.

Например,<BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x590))>обычно оценивают до<1>для всех значений<__BORLANDC__>, если тольконе определен макрос<BOOST_DETECT_OUTDATED_WORKAROUNDS>, и в этом случае оценивают до<(__BORLANDC__<= 0x590)>

Примечание: Конечным источником документации для этого макроса являетсяboost/detail/workaround.hpp

.

BOOST_PREVENT_MACRO_SUBSTITUTION

Sometimes you have a function name with the same name as a C macro, for example "min" and "max" member functions, in which case one can prevent the function being expanded as a macro using:

someclass.min BOOST_PREVENT_MACRO_SUBSTITUTION(arg1, arg2);

The following also works in most, but not all, contexts:

(someclass.max)(arg1, arg2);

BOOST_DEDUCED_TYPENAME

Some compilers don't support the use of typename for dependent types in deduced contexts. This macro expands to nothing on those compilers, and typename elsewhere. For example, replace: template <class T> void f(T, typename T::type); with: template <class T> void f(T, BOOST_DEDUCED_TYPENAME T::type);

<BOOST_HASH_MAP_HEADER>

Заголовок для включения, чтобы получить класс SGI<hash_map>. Этот макрос доступен только при определении<BOOST_HAS_HASH>.

BOOST_HASH_SET_HEADER

The header to include to get the SGI hash_set class. This macro is only available if BOOST_HAS_HASH is defined.

BOOST_SLIST_HEADER

The header to include to get the SGI slist class. This macro is only available if BOOST_HAS_SLIST is defined.

BOOST_STD_EXTENSION_NAMESPACE

The namespace used for std library extensions (hashtable classes etc).

BOOST_STATIC_CONSTANT(Type, assignment)

На компиляторах, которые не позволяют в классе инициализации статических интегральных постоянных членов, мы должны использовать числа в качестве обходного пути, если мы хотим, чтобы константы были доступны во время компиляции. Этот макрос дает нам удобный способ объявления таких констант. Например, вместо:

<
structfoo{
  staticconstintvalue=2;
};
>

используйте:

<
structfoo{
  BOOST_STATIC_CONSTANT(int,value=2);
};
>

<BOOST_UNREACHABLE_RETURN(result)>

Normally evaluates to nothing, but evaluates to return x; if the compiler requires a return, even when it can never be reached.

BOOST_FALLTHROUGH

The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through between switch labels:

switch (x) {
case 40:
case 41:
   if (truth_is_out_there) {
      ++x;
      BOOST_FALLTHROUGH;  // Use instead of/along with annotations in 
      // comments. 
   } else {
     return x;
   }
   case 42:
      ...

As shown in the example above, the BOOST_FALLTHROUGH macro should be followed by a semicolon. It is designed to mimic control-flow statements like 'break;', so it can be placed in most places where 'break;' can, but only if there are no statements on the execution path between it and the next switch label.

When compiled with Clang >3.2 in C++11 mode, the BOOST_FALLTHROUGH macro is expanded to [[clang::fallthrough]] attribute, which is analysed when performing switch labels fall-through diagnostic ('-Wimplicit-fallthrough'). See clang documentation on language extensions for details.

When used with unsupported compilers, the BOOST_FALLTHROUGH macro has no effect on diagnostics.

In either case this macro has no effect on runtime behavior and performance of code.

BOOST_EXPLICIT_TEMPLATE_TYPE(t) BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t,v) BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t,v)

Some compilers silently "fold" different function template instantiations if some of the template parameters don't appear in the function parameter list. For instance:

#include <iostream>
#include <ostream>
#include <typeinfo>
template <int n>
void f() { std::cout << n << ' '; }
template <typename T>
void g() { std::cout << typeid(T).name() << ' '; }
int main() {
  f<1>();
  f<2>();
  g<int>();
  g<double>();
}

incorrectly outputs 2 2 double double on VC++ 6. These macros, to be used in the function parameter list, fix the problem without effects on the calling syntax. For instance, in the case above write:

template <int n>
void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
template <typename T>
void g(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... }

Beware that they can declare (for affected compilers) a dummy defaulted parameter, so they

a) should be always invoked at the end of the parameter list

b) can't be used if your function template is multiply declared.

Furthermore, in order to add any needed comma separator, an APPEND_* version must be used when the macro invocation appears after a normal parameter declaration or after the invocation of another macro of this same group.

BOOST_USE_FACET(Type, loc)

Когда стандартная библиотека не имеет соответствующей<std::use_facet>, существуют различные обходные пути, но они отличаются от библиотеки к библиотеке. Этот макрос обеспечивает последовательный способ доступа к граням локализации. Например, заменить:<std::use_facet<Type>(loc);>на:<BOOST_USE_FACET(Type,loc);>. Не добавляйте приставку<std::>к передней части<BOOST_USE_FACET>

.

<BOOST_HAS_FACET(Type,loc)>

When the standard library does not have a comforming std::has_facet there are various workarounds available, but they differ from library to library. This macro provides a consistent way to check a locale's facets. For example, replace: std::has_facet<Type>(loc); with: BOOST_HAS_FACET(Type, loc); Note do not add a std:: prefix to the front of BOOST_HAS_FACET.

<BOOST_NESTED_TEMPLATE>

Member templates are supported by some compilers even though they can't use the A::template member<U> syntax, as a workaround replace: typedef typename A::template rebind<U> binder; with: typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;

<BOOST_STRINGIZE(X)>

Converts the parameter X to a string after macro replacement on X has been performed.

BOOST_JOIN(X,Y)

Эта часть макромагии объединяет два аргумента вместе, даже если один из аргументов сам по себе является макросом (см. 16.3.1 в стандарте C++). Обычно это используется для создания искажённого имени в сочетании с предопределенным макросом, таким как __LINE__.

BOOST_FORCEINLINE

This macro can be used in place of the inline keyword to instruct the compiler that the function should always be inlined. Overuse of this macro can lead to significant bloat, while good use can increase performance in certain cases, such as computation-intensive code built through generative programming techniques.

Usage example:

template<class T>
BOOST_FORCEINLINE T& f(T& t)
{
    return t;
}

Note that use of this macro can lead to cryptic error messages with some compilers. Consider defining it to inline before including the Boost.Config header in order to be able to debug errors more easily.

BOOST_NOINLINE

Этот макрос может быть использован вместо ключевого слова<inline>для указания компилятору, что функция никогда не должна быть включена. Обычно следует использовать этот макрос для маркировки функций, которые вряд ли будут называться, таких как процедуры обработки ошибок.

Пример использования:

<
BOOST_NOINLINEvoidhandle_error(constchar*descr)
{
   // ...
}
>

<BOOST_NORETURN>

This macro can be used before the function declaration or definition to instruct the compiler that the function does not return normally (i.e. with a return statement or by leaving the function scope, if the function return type is void). The macro can be used to mark functions that always throw exceptions or terminate the application. Compilers that support this markup may use this information to specifically organize the code surrounding calls to this function and suppress warnings about missing return statements in the functions enclosing such calls.

Usage example:

BOOST_NORETURN void on_error_occurred(const char* descr)
{
    throw std::runtime_error(descr);
}

If the compiler does not support this markup, BOOST_NORETURN is defined empty and an additional macro BOOST_NO_NORETURN is defined.

BOOST_LIKELY(X) BOOST_UNLIKELY(X)

These macros communicate to the compiler that the conditional expression X is likely or unlikely to yield a positive result. The expression should result in a boolean value. The result of the macro is an integer or boolean value equivalent to the result of X.

The macros are intended to be used in branching statements. The additional hint they provide can be used by the compiler to arrange the compiled code of the branches more effectively.

Usage example:

if (BOOST_UNLIKELY(ptr == NULL))
  handle_error("ptr is NULL");

<BOOST_ATTRIBUTE_UNUSED>

Expands to __attribute__((unused)) when this is available - can be used to disable compiler warnings relating to unused types or variables.

Следующие макросы описывают функции повышения; это, вообще говоря, единственные макросы повышения, которые должны быть протестированы в пользовательском коде.

Макро

Заголовок

Описание

<BOOST_VERSION>

<boost/version.hpp>

Describes the boost version number in XYYYZZ format such that: (BOOST_VERSION % 100) is the sub-minor version, ((BOOST_VERSION / 100) % 1000) is the minor version, and (BOOST_VERSION / 100000) is the major version.

BOOST_NO_INT64_T

<boost/cstdint.hpp> <boost/stdint.h>

Defined if there are no 64-bit integral types: int64_t, uint64_t etc.

BOOST_NO_INTEGRAL_INT64_T

<boost/cstdint.hpp> <boost/stdint.h>

Defined if int64_t as defined by <boost/cstdint.hpp> is not usable in integral constant expressions.

<BOOST_MSVC>

<<boost/config.hpp>>

Defined if the compiler is really Microsoft Visual C++, as opposed to one of the many other compilers that also define _MSC_VER. Has the same value as _MSC_VER.

BOOST_MSVC_FULL_VER

<<boost/config.hpp>>

Defined to a normalised 9 digit version of _MSC_FULL_VER (which sometimes only has 8 digits), the macro has the form VVMMPPPPP where VV is the major version number, MM is the minor version number, and PPPPP is the compiler build number.

BOOST_GCC

<<boost/config.hpp>>

Defined if the compiler is really GCC, as opposed to one of the many other compilers that also define __GNUC__. Has the value: __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__.

<BOOST_INTEL>

<<boost/config.hpp>>

Определенный, если компилятор является компилятором Intel, принимает то же значение, что и макрос версии компилятора.

<BOOST_CLANG>

<<boost/config.hpp>>

Определено до 1, если компилятором является компилятор Clang.

BOOST_WINDOWS

<<boost/config.hpp>>

Defined if the Windows platform API is available.

<BOOST_DINKUMWARE_STDLIB>

<<boost/config.hpp>>

Defined if the dinkumware standard library is in use, takes the same value as the Dinkumware library version macro _CPPLIB_VER if defined, otherwise 1.

BOOST_NO_WREGEX

<boost/regex.hpp>

Defined if the regex library does not support wide character regular expressions.

<BOOST_COMPILER>

<<boost/config.hpp>>

Defined as a string describing the name and version number of the compiler in use. Mainly for debugging the configuration.

<BOOST_STDLIB>

<<boost/config.hpp>>

Defined as a string describing the name and version number of the standard library in use. Mainly for debugging the configuration.

<BOOST_PLATFORM>

<<boost/config.hpp>>

Defined as a string describing the name of the platform. Mainly for debugging the configuration.

Ниже приведены амортизационные меры; пожалуйста, используйте замену. Они будут удалены в будущей версии.

Устаревший Макро

Замена

Когда обесценивается

когда удаляется

BOOST_NO_0X_HDR_ARRAY

<BOOST_NO_CXX11_HDR_ARRAY>

Повышение на 1,50

BOOST_NO_0X_HDR_CHRONO

BOOST_NO_CXX11_HDR_CHRONO

Повышение на 1,50

BOOST_NO_0X_HDR_CODECVT

<BOOST_NO_CXX11_HDR_CODECVT>

Повышение на 1,50

BOOST_NO_0X_HDR_CONDITION_VARIABLE

BOOST_NO_CXX11_HDR_CONDITION_VARIABLE

Повышение на 1,50

<BOOST_NO_0X_HDR_FORWARD_LIST>

<BOOST_NO_CXX11_HDR_FORWARD_LIST>

Повышение на 1,50

BOOST_NO_0X_HDR_FUTURE

BOOST_NO_CXX11_HDR_FUTURE

Повышение на 1,50

<BOOST_NO_0X_HDR_INITIALIZER_LIST>

<BOOST_NO_CXX11_HDR_INITIALIZER_LIST>

Повышение на 1,50

BOOST_NO_INITIALIZER_LISTS

<BOOST_NO_CXX11_HDR_INITIALIZER_LIST>

Повышение на 1,50

<BOOST_NO_0X_HDR_MUTEX>

<BOOST_NO_CXX11_HDR_MUTEX>

Повышение на 1,50

BOOST_NO_0X_HDR_RANDOM

BOOST_NO_CXX11_HDR_RANDOM

Повышение на 1,50

<BOOST_NO_0X_HDR_RATIO>

BOOST_NO_CXX11_HDR_RATIO

Повышение на 1,50

<BOOST_NO_0X_HDR_REGEX>

<BOOST_NO_CXX11_HDR_REGEX>

Повышение на 1,50

<BOOST_NO_0X_HDR_SYSTEM_ERROR>

BOOST_NO_CXX11_HDR_SYSTEM_ERROR

Повышение на 1,50

BOOST_NO_0X_HDR_THREAD

<BOOST_NO_CXX11_HDR_THREAD>

Повышение на 1,50

<BOOST_NO_0X_HDR_TUPLE>

BOOST_NO_CXX11_HDR_TUPLE

Повышение на 1,50

<BOOST_NO_0X_HDR_TYPE_TRAITS>

BOOST_NO_CXX11_HDR_TYPE_TRAITS

Повышение на 1,50

<BOOST_NO_0X_HDR_TYPEINDEX>

BOOST_NO_CXX11_HDR_TYPEINDEX

Повышение на 1,50

BOOST_NO_0X_HDR_UNORDERED_SET

<BOOST_NO_CXX11_HDR_UNORDERED_SET>

Повышение на 1,50

BOOST_NO_0X_HDR_UNORDERED_MAP

<BOOST_NO_CXX11_HDR_UNORDERED_MAP>

Повышение на 1,50

BOOST_NO_STD_UNORDERED

<BOOST_NO_CXX11_HDR_UNORDERED_SET>

Повышение на 1,50

<BOOST_NO_AUTO_DECLARATIONS>

<BOOST_NO_CXX11_AUTO_DECLARATIONS>

Boost 1.51

<BOOST_NO_AUTO_MULTIDECLARATIONS>

<BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS>

Boost 1.51

<BOOST_NO_CHAR16_T>

BOOST_NO_CXX11_CHAR16_T

Boost 1.51

BOOST_NO_CHAR32_T

<BOOST_NO_CXX11_CHAR32_T>

Boost 1.51

BOOST_NO_TEMPLATE_ALIASES

<BOOST_NO_CXX11_TEMPLATE_ALIASES>

Boost 1.51

BOOST_NO_CONSTEXPR

<BOOST_NO_CXX11_CONSTEXPR>

Boost 1.51

<BOOST_NO_DECLTYPE>

BOOST_NO_CXX11_DECLTYPE

Boost 1.51

BOOST_NO_DECLTYPE_N3276

BOOST_NO_CXX11_DECLTYPE_N3276

Boost 1.51

<BOOST_NO_DEFAULTED_FUNCTIONS>

BOOST_NO_CXX11_DEFAULTED_FUNCTIONS

Boost 1.51

BOOST_NO_DELETED_FUNCTIONS

BOOST_NO_CXX11_DELETED_FUNCTIONS

Boost 1.51

<BOOST_NO_EXPLICIT_CONVERSION_OPERATORS>

BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS

Boost 1.51

BOOST_NO_EXTERN_TEMPLATE

BOOST_NO_CXX11_EXTERN_TEMPLATE

Boost 1.51

BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS

<BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS>

Boost 1.51

<BOOST_NO_LAMBDAS>

<BOOST_NO_CXX11_LAMBDAS>

Boost 1.51

<BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS>

BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS

Boost 1.51

BOOST_NO_NOEXCEPT

BOOST_NO_CXX11_NOEXCEPT

Boost 1.51

<BOOST_NO_NULLPTR>

BOOST_NO_CXX11_NULLPTR

Boost 1.51

<BOOST_NO_RAW_LITERALS>

BOOST_NO_CXX11_RAW_LITERALS

Boost 1.51

<BOOST_NO_RVALUE_REFERENCES>

<BOOST_NO_CXX11_RVALUE_REFERENCES>

Boost 1.51

<BOOST_NO_SCOPED_ENUMS>

BOOST_NO_CXX11_SCOPED_ENUMS

Boost 1.51

BOOST_NO_STATIC_ASSERT

BOOST_NO_CXX11_STATIC_ASSERT

Boost 1.51

BOOST_NO_STD_UNORDERED

BOOST_NO_CXX11_STD_UNORDERED

Boost 1.51

BOOST_NO_UNICODE_LITERALS

<BOOST_NO_CXX11_UNICODE_LITERALS>

Boost 1.51

BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX

BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX

Boost 1.51

BOOST_NO_VARIADIC_TEMPLATES

BOOST_NO_CXX11_VARIADIC_TEMPLATES

Boost 1.51

<BOOST_NO_VARIADIC_MACROS>

<BOOST_NO_CXX11_VARIADIC_MACROS>

Boost 1.51

BOOST_NO_NUMERIC_LIMITS_LOWEST

BOOST_NO_CXX11_NUMERIC_LIMITS

Boost 1.51

BOOST_HAS_STATIC_ASSERT

BOOST_NO_CXX11_STATIC_ASSERT (negated)

Boost 1.53

BOOST_HAS_VARIADIC_TMPL

<BOOST_NO_CXX11_VARIADIC_TEMPLATES>(отрицательно)

Boost 1.53

BOOST_HAS_RVALUE_REFS

BOOST_NO_CXX11_RVALUE_REFERENCES (negated)

Boost 1.53

BOOST_HAS_CHAR16_T

<BOOST_NO_CXX11_CHAR16_T>(отрицательно)

Boost 1.53

<BOOST_HAS_CHAR32_T>

BOOST_NO_CXX11_CHAR32_T (negated)

Boost 1.53

Следующие макросы и вспомогательные заголовки используются для авторов, чьи библиотеки содержат отдельный исходный код, и предназначены для решения нескольких вопросов:

  • Контроль видимости общего символа библиотеки
  • Исправление ABI компилируемой библиотеки
  • Выбор того, какую скомпилированную библиотеку связать на основе настроек компиляторов

См.Руководство для авторов библиотек, содержащих отдельный источник

Некоторые компиляторы поддерживают расширения C++, которые контролируют, какие символы будут экспортироваться из общих библиотек, таких как динамические общие объекты (DSO) в Unix-подобных системах или библиотеки динамических ссылок (DLL) в Windows.

Компилятор Microsoft VC++ уже давно поставляет расширения<__declspec(dllexport)>и<__declspec(dllimport)>для этой цели, как и практически все другие компиляторы, ориентированные на платформу Windows.

Современные версии компилятора GNU GCC предоставляют расширение<__attribute__((visibility("default")))>, чтобы указать, что символ должен быть экспортирован. Все остальные символы могут быть скрыты с помощью переключателей компилятора<-fvisibility-hidden>или<-fvisibility-ms-compat>.

Boost поставляет несколько макросов, чтобы упростить управление видимостью символа таким образом, чтобы он был переносим между компиляторами и операционными системами.

Макро

Описание

<BOOST_SYMBOL_EXPORT>

Определяет синтаксис расширения языка C++, который указывает, что символ должен быть экспортирован из общей библиотеки. Если компилятор не имеет такого расширения, макрос определяется без замены текста.

<BOOST_SYMBOL_IMPORT>

Определяет синтаксис расширения языка C++, который указывает, что символ должен быть импортирован из общей библиотеки. Если компилятор не имеет такого расширения, макрос определяется без замены текста.

<BOOST_SYMBOL_VISIBLE>

Определяет синтаксис расширения языка C++, который указывает, что символ должен быть глобально видимым. Если компилятор не имеет такого расширения, макрос определяется без замены текста. Необходим для классов, которые иначе не экспортируются, а используются РТТИ. Примеры включают класс для объектов, которые будут выброшены в виде исключений или использованы в динамических передачах, через общие границы библиотеки. Например, класс исключений только для заголовков может выглядеть так:

<
classBOOST_SYMBOL_VISIBLEmy_exception:publicstd::runtime_error{...};
>

Без BOOST_SYMBOL_VISIBLE было бы невозможно поймать мое исключение, выброшенное из общей библиотеки, составленной GCC, с опцией -fvisibility=hidden.

<BOOST_HAS_DECLSPEC>

Компилятор имеет расширения C++<__declspec(dllexport)>и<__declspec(dllimport)>для управления экспортом/импортом символов из общих библиотек.Уничижение. Этот макрос больше не нужен, поскольку теперь поставляются BOOST_SYMBOL_EXPORT и BOOST_SYMBOL_IMPORT. Он предназначен для поддержки устаревшего кода.

Типичное использование:

boost/foo/config.hpp

...
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FOO_DYN_LINK)
# if defined(BOOST_FOO_SOURCE)
#   define BOOST_FOO_DECL BOOST_SYMBOL_EXPORT
# else
#   define BOOST_FOO_DECL BOOST_SYMBOL_IMPORT
# endif
#else
# define BOOST_FOO_DECL
#endif
...

boost/foo/foo.hpp

#include <boost/foo/config.hpp>
...
class BOOST_FOO_DECL bar { ... };
...
void BOOST_FOO_DECL f();
...

boost/libs/foo/src/foo.cpp

#define BOOST_FOO_SOURCE
#include <boost/foo/foo.hpp>
...
void BOOST_FOO_DECL f()
{
  ...
}
...

При связывании с предварительно собранной библиотекой важно, чтобы ABI, используемый компилятором при создании библиотеки, точно соответствовалABI, используемому кодом с использованием библиотеки. В этом случае ABI означает такие вещи, как используемая структура упаковки, используемая схема манглинга или размер некоторых типов (например, типов эмали). Это отдельно от таких вещей, как поддержка потоков или вариации библиотеки времени выполнения, с которыми приходится иметь дело при создании вариантов. Чтобы представить это в перспективе, есть один компилятор (Borland's), который имеет так много вариантов компилятора, которые вносят тонкие изменения в ABI, что, по крайней мере, в теории существует 3200 комбинаций, и это без учета вариаций библиотеки времени выполнения. К счастью, эти изменения могут управляться<#pragma>, которые сообщают компилятору, что ABI использовать для типов, объявленных в вашей библиотеке. Чтобы избежать разбрызгивания<#pragma>по всем заголовкам бустера, есть некоторые префиксы и суффиксы, которые выполняют работу. Типичным использованием является:

my_library.hpp

#ifndef MY_INCLUDE_GUARD
#define MY_INCLUDE_GUARD
// all includes go here:
#include <boost/config.hpp>
#include <whatever>
#include <boost/config/abi_prefix.hpp> // must be the last #include
namespace boost {
// your code goes here
}
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
#endif // include guard

my_library.cpp

...
// nothing special need be done in the implementation file
...

Пользователь может отключить этот механизм, определив<BOOST_DISABLE_ABI_HEADERS>, или они могут определить<BOOST_ABI_PREFIX>и/или<BOOST_ABI_SUFFIX>, чтобы указать на свои собственные заголовки префикса/суффикса, если они того пожелают.

Важно, чтобы пользователи ссылались на сборку библиотеки, которая была построена против той же библиотеки времени выполнения, против которой будет построено их приложение - если этого не произойдет, то библиотека не будет бинарно совместима с их собственным кодом - и существует высокая вероятность того, что их приложение будет испытывать сбои времени выполнения. Такие проблемы могут быть чрезвычайно трудоемкими и трудными для отладки, и часто приводят к разочарованию как пользователей, так и авторов (просто выбрать правильную библиотеку для ссылки не так просто, как кажется, когда их 6-8 из них на выбор, и некоторые пользователи, кажется, блаженно не знают, что для них даже доступны различные среды выполнения).

Чтобы решить эту проблему, некоторые компиляторы позволяют исходному коду содержать<#pragma>, которые инструктируют линкера, с какой библиотекой связываться, все, что нужно пользователю, это включить заголовки, которые им нужны, поместить скомпилированные библиотеки в свой путь поиска библиотеки, а компилятор и линкер сделать все остальное. Boost.config поддерживает это через заголовок<<boost/config/auto_link.hpp>>, прежде чем включать этот заголовок, необходимо определить один или несколько из следующих макросов:

BOOST_LIB_NAME

Требуется: Идентификатор, содержащий имя базы библиотеки, например «boost_regex».

BOOST_DYN_LINK

Необязательно: при установке ссылки на dll, а не на статическую библиотеку.

BOOST_LIB_DIAGNOSTIC

Необязательно: при установке заголовка будет распечатываться название выбранной библиотеки (полезно для отладки).

Если компилятор поддерживает этот механизм, то ему будет предложено связать с соответствующим названием библиотеки, фактический алгоритм, используемый для спутывания имени библиотеки, документируется внутри<<boost/config/auto_link.hpp>>и должен соответствовать тому, который используется для создания библиотек через правила установки bjam.

my_library.hpp

...
//
// Don't include auto-linking code if the user has disabled it by
// defining BOOST_ALL_NO_LIB, or BOOST_MY_LIBRARY_NO_LIB, or if this 
// is one of our own source files (signified by BOOST_MY_LIBRARY_SOURCE):
//
#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_MY_LIBRARY_NO_LIB) && !defined(BOOST_MY_LIBRARY_SOURCE)
#  define BOOST_LIB_NAME boost_my_library
#  ifdef BOOST_MY_LIBRARY_DYN_LINK
#     define BOOST_DYN_LINK
#  endif
#  include <boost/config/auto_link.hpp>
#endif
...

my_library.cpp

// define BOOST_MY_LIBRARY_SOURCE so that the header knows that the
// library is being built (possibly exporting rather than importing code)
//
#define BOOST_MY_LIBRARY_SOURCE
#include <boost/my_library/my_library.hpp>
...

PrevUpHomeNext

Статья Boost Macro Reference раздела Boost.Config Boost.Config может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Boost.Config ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-07-05 06:44:35/0.01923394203186/0