diff --git a/doc/html/boost_config/acknowledgements.html b/doc/html/boost_config/acknowledgements.html index f8143ae3..8286d72d 100644 --- a/doc/html/boost_config/acknowledgements.html +++ b/doc/html/boost_config/acknowledgements.html @@ -3,7 +3,7 @@ Acknowledgements - + diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index bcf14049..e90f2701 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -3,7 +3,7 @@ Boost Macro Reference - + @@ -315,7 +315,7 @@

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

template<typename T>
 struct foo : {
@@ -341,8 +341,9 @@
 
                 

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

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

@@ -421,7 +422,7 @@

The compiler does not perform function template ordering or its - function template ordering is incorrect. + function template ordering is incorrect.

// #1
 template<class T> void f(T);
@@ -1313,7 +1314,7 @@
 
                 

The compiler does not allow a void function to return the result - of calling another void function. + of calling another void function.

void f() {}
 void g() { return f(); }
@@ -2917,12 +2918,12 @@
                 

Some compilers don't support the use of constexpr. This macro expands to nothing on those compilers, and constexpr elsewhere. For example, - when defining a constexpr function or constructor replace: + when defining a constexpr function or constructor replace:

constexpr tuple();
 

- with: + with:

BOOST_CONSTEXPR tuple();
 
@@ -2942,11 +2943,12 @@ 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: + with:

static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a;
 
@@ -2964,12 +2966,12 @@

This is a shortcut for static BOOST_CONSTEXPR_OR_CONSTFor - example, when defining const expr variables replace: + example, when defining const expr variables replace:

static constexpr UIntType xor_mask = a;
 

- with: + with:

BOOST_STATIC_CONSTEXPR UIntType xor_mask = a;
 
@@ -2980,6 +2982,7 @@

+

BOOST_NOEXCEPT
 BOOST_NOEXCEPT_IF(Predicate)
@@ -2996,6 +2999,7 @@
                 

+

#define BOOST_NOEXCEPT
 #define BOOST_NOEXCEPT_IF(Predicate)
@@ -3011,6 +3015,7 @@
                 

+

#define BOOST_NOEXCEPT noexcept
 #define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
@@ -3061,12 +3066,12 @@
                 

This macro is used where a compiler specific workaround is required that is not otherwise described by one of the other Boost.Config - macros. To use the macro you must first + macros. To use the macro you must first

#include <boost/detail/workaround.hpp>
 

- usage is then: + usage is then:

#if BOOST_WORKAROUND(MACRONAME, CONDITION)
    // workaround code goes here...
@@ -3109,12 +3114,12 @@
                   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:
+                  macro using: 
 

someclass.min BOOST_PREVENT_MACRO_SUBSTITUTION(arg1, arg2);
 

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

(someclass.max)(arg1, arg2);
 
@@ -3209,14 +3214,14 @@ integral constant members, we must use enums as a workaround if we want the constants to be available at compile-time. This macro gives us a convenient way to declare such constants. For example - instead of: + instead of:

struct foo{
    static const int value = 2;
 };
 

- use: + use:

struct foo{
    BOOST_STATIC_CONSTANT(int, value = 2);
@@ -3249,7 +3254,7 @@
                 

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

#include <iostream>
 #include <ostream>
@@ -3273,7 +3278,7 @@
                   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:
+                  in the case above write: 
 

template <int n>
 void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
@@ -3383,6 +3388,40 @@
                 

+ + +

+ BOOST_FORCEINLINE +

+ + +

+ This macro can be used in place of the inline + keyword to instruct the compiler that a 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. +

+ +
@@ -3783,7 +3822,7 @@ RTTI. Examples include class for objects that will be thrown as exceptions or used in dynamic_casts, across shared library boundaries. For example, a header-only exception class might - look like this: + look like this:

class BOOST_SYMBOL_VISIBLE my_exception : public std::runtime_error { ... };
 
@@ -3821,7 +3860,7 @@ #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FOO_DYN_LINK) # if defined(BOOST_FOO_SOURCE) # define BOOST_FOO_DECL BOOST_SYMBOL_EXPORT -# else +# else # define BOOST_FOO_DECL BOOST_SYMBOL_IMPORT # endif #else @@ -3843,7 +3882,7 @@ boost/libs/foo/src/foo.cpp

#define BOOST_FOO_SOURCE
-#include <boost/foo/foo.hpp>
+#include <boost/foo/foo.hpp>    
 ...
 void BOOST_FOO_DECL f()
 {
diff --git a/doc/html/boost_config/guidelines_for_boost_authors.html b/doc/html/boost_config/guidelines_for_boost_authors.html
index 1079480d..cbc7dbce 100644
--- a/doc/html/boost_config/guidelines_for_boost_authors.html
+++ b/doc/html/boost_config/guidelines_for_boost_authors.html
@@ -3,7 +3,7 @@
 
 Guidelines for Boost Authors
 
-
+
 
 
 
diff --git a/doc/html/boost_config/rationale.html b/doc/html/boost_config/rationale.html
index f92d7993..d62510c1 100644
--- a/doc/html/boost_config/rationale.html
+++ b/doc/html/boost_config/rationale.html
@@ -3,7 +3,7 @@
 
 Rationale
 
-
+
 
 
 
diff --git a/doc/html/index.html b/doc/html/index.html
index 9c7fb0b1..9dc678b1 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -3,7 +3,7 @@
 
 Boost.Config
 
-
+
 
 
 
@@ -29,7 +29,7 @@
 
-

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

@@ -277,7 +277,7 @@ export CXXFLAGS="-Aa -DAportable -D__HPACC_THREAD_SAFE_RB_TREE \ -DRWSTD_MULTI_THREAD -DRW_MULTI_THREAD -D_REENTRANT -D_THREAD_SAFE" export LDFLAGS="-DAportable" -export LIBS="-lpthread" +export LIBS="-lpthread" sh ./configure

@@ -949,7 +949,7 @@ - +

Last revised: October 10, 2011 at 14:43:27 GMT

Last revised: October 11, 2011 at 17:21:29 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 2ed236a2..c5dad035 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -889,6 +889,26 @@ the arguments is itself a macro (see 16.3.1 in C++ standard). This is normally used to create a mangled name in combination with a predefined macro such a \_\_LINE__. ]] +[[`BOOST_FORCEINLINE`][ +This macro can be used in place of the `inline` keyword to instruct the compiler +that a 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 + 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. +]] ] [endsect] diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index c2bbcb70..72a0dc95 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -688,5 +688,17 @@ namespace std{ using ::type_info; } #define BOOST_STATIC_CONSTEXPR static BOOST_CONSTEXPR_OR_CONST +// BOOST_FORCEINLINE ---------------------------------------------// +// Macro to use in place of 'inline' to force a function to be inline +#if !defined(BOOST_FORCEINLINE) +# if defined(_MSC_VER) +# define BOOST_FORCEINLINE __forceinline +# elif defined(__GNUC__) && __GNUC__ > 3 +# define BOOST_FORCEINLINE inline __attribute__ ((always_inline)) +# else +# define BOOST_FORCEINLINE inline +# endif +#endif + #endif diff --git a/test/config_info.cpp b/test/config_info.cpp index c0612bfc..3877f001 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1111,6 +1111,8 @@ void print_boost_macros() PRINT_MACRO(BOOST_CONSTEXPR); PRINT_MACRO(BOOST_CONSTEXPR_OR_CONST); PRINT_MACRO(BOOST_STATIC_CONSTEXPR); + PRINT_MACRO(BOOST_NOEXCEPT); + PRINT_MACRO(BOOST_FORCEINLINE); } void print_separator()