diff --git a/build/Jamfile b/build/Jamfile index 19f1c60..ce5fb17 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -13,16 +13,18 @@ rule wave actions wave { - chdir $(BOOST_ROOT)/libs/function_types/build $(BOOST_ROOT)/dist/bin/wave -S$(BOOST_ROOT) $(>) -o $(<) } make $(BOOST_ROOT)/libs/function_types/build/timestamps/arity_loops - : preprocess_arity_loops.cpp : wave ; + : preprocess_arity_loops.cpp : wave + ; make $(BOOST_ROOT)/libs/function_types/build/timestamps/encoding - : preprocess_encoding.cpp : wave ; + : preprocess_encoding.cpp : wave + ; make $(BOOST_ROOT)/libs/function_types/build/timestamps/cc_names - : preprocess_cc_names.cpp : wave ; + : preprocess_cc_names.cpp : wave + ; diff --git a/build/timestamps/cc_names b/build/timestamps/cc_names index f91091c..e33ac14 100644 --- a/build/timestamps/cc_names +++ b/build/timestamps/cc_names @@ -1 +1,2 @@ timestamp file + diff --git a/doc/Jamfile b/doc/Jamfile index b286aea..5b46953 100644 --- a/doc/Jamfile +++ b/doc/Jamfile @@ -13,8 +13,6 @@ boostbook standalone : boost.root=../../../.. boost.libraries=../../../libraries.htm - nav.layout=none - navig.graphics=0 chunk.first.sections=1 chunk.section.depth=2 generate.section.toc.level=2 diff --git a/doc/function_types.qbk b/doc/function_types.qbk index 2a6d83f..0f989ae 100644 --- a/doc/function_types.qbk +++ b/doc/function_types.qbk @@ -1086,6 +1086,7 @@ Thanks go to the following people for supporting the development of this library in one or the other way: * David Abrahams +* Tom Brinkman * Aleksey Gurtovoy * Jody Hagins * Hartmut Kaiser @@ -1093,9 +1094,11 @@ library in one or the other way: * John Maddock * Paul Mensonides * Alexander Nasonov +* Richard Smith * Rob Stewart * Jonathan Turkanis * Pavel Vozenilek +* Steven Watanabe [endsect] diff --git a/doc/html/boost_functiontypes/about_tag_types.html b/doc/html/boost_functiontypes/about_tag_types.html index 80413e7..217b2ab 100644 --- a/doc/html/boost_functiontypes/about_tag_types.html +++ b/doc/html/boost_functiontypes/about_tag_types.html @@ -10,10 +10,17 @@ -
Boost C++ Libraries
+ + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore

@@ -81,7 +88,7 @@
diff --git a/doc/html/boost_functiontypes/acknowledgements.html b/doc/html/boost_functiontypes/acknowledgements.html index 441ab7c..e8c7c26 100644 --- a/doc/html/boost_functiontypes/acknowledgements.html +++ b/doc/html/boost_functiontypes/acknowledgements.html @@ -9,10 +9,17 @@ -
Boost C++ Libraries
+ + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore

@@ -25,6 +32,9 @@
  • David Abrahams
  • +
  • + Tom Brinkman +
  • Aleksey Gurtovoy
  • @@ -46,6 +56,9 @@
  • Alexander Nasonov
  • +
  • + Richard Smith +
  • Rob Stewart
  • @@ -55,6 +68,9 @@
  • Pavel Vozenilek
  • +
  • + Steven Watanabe +
  • @@ -63,7 +79,7 @@

    diff --git a/doc/html/boost_functiontypes/introduction.html b/doc/html/boost_functiontypes/introduction.html index 5047583..58151d4 100644 --- a/doc/html/boost_functiontypes/introduction.html +++ b/doc/html/boost_functiontypes/introduction.html @@ -10,10 +10,17 @@ -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    @@ -81,7 +88,7 @@
    diff --git a/doc/html/boost_functiontypes/rationale.html b/doc/html/boost_functiontypes/rationale.html index fc44924..1b71df4 100644 --- a/doc/html/boost_functiontypes/rationale.html +++ b/doc/html/boost_functiontypes/rationale.html @@ -10,16 +10,23 @@ -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    - + Error handling rationale

    @@ -34,7 +41,7 @@ can be spotted easily.

    - + Why MPL Sequences?

    @@ -47,19 +54,16 @@ so another reason is interoperability.

    - + Pointer to member object types

    Despite their syntax, pointer to member object types can be seen as dereferencing - functionals. A reference is not added to the - "result", however, to allow greater flexibility (once a reference - has been added there's no way to determine whether the referencee was a reference - already). + functionals.

    - + The ClassTransform template parameter

    @@ -76,7 +80,7 @@ all parameters uniformly.

    - + Why tag types?

    @@ -95,7 +99,7 @@ with older compilers.

    - + Is it safe to have the synthesis templates take a callable builtin type or an MPL sequence as the first template argument? @@ -110,7 +114,7 @@ type a sequence have been included, which can easily violate the ODR.

    - + Why does the hidden this parameter count for the function arity of member functions? @@ -124,7 +128,7 @@ function_arity">function_arity<T>::value

    - + Why ignore top-level cv-qualifiers on pointers?

    @@ -139,7 +143,7 @@
    diff --git a/doc/html/boost_functiontypes/reference.html b/doc/html/boost_functiontypes/reference.html index 8529eba..f54c521 100644 --- a/doc/html/boost_functiontypes/reference.html +++ b/doc/html/boost_functiontypes/reference.html @@ -11,10 +11,17 @@ templates for type classification"> -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    @@ -36,7 +43,7 @@
    diff --git a/doc/html/boost_functiontypes/reference/classification.html b/doc/html/boost_functiontypes/reference/classification.html index 4d0cb94..7ef1d9e 100644 --- a/doc/html/boost_functiontypes/reference/classification.html +++ b/doc/html/boost_functiontypes/reference/classification.html @@ -12,10 +12,17 @@ for type decomposition"> -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    @@ -60,23 +67,23 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    Tag
    -
    - Further properties required for a positive result -
    +

    + Further properties required for a positive result +

    is_function<T,Tag>
    -
    - Predicate value as MPL - - Integral - Constant -
    +

    + Predicate value as MPL + - Integral + Constant +

    is_function<T,Tag>::value
    -
    - Constant boolean value -
    +

    + Constant boolean value +

    @@ -104,21 +111,23 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    Tag
    -
    - Further properties required for a positive result -
    +

    + Further properties required for a positive result +

    is_function_pointer<T,Tag>
    -
    - Predicate value MPL - Integral Constant -
    +

    + Predicate value MPL - + Integral + Constant +

    is_function_pointer<T,Tag>::value
    -
    - Constant boolean value -
    +

    + Constant boolean value +

    @@ -146,21 +155,23 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    Tag
    -
    - Further properties required for a positive result -
    +

    + Further properties required for a positive result +

    is_function_reference<T,Tag>
    -
    - Predicate value MPL - Integral Constant -
    +

    + Predicate value MPL - + Integral + Constant +

    is_function_reference<T,Tag>::value
    -
    - Constant boolean value -
    +

    + Constant boolean value +

    @@ -188,21 +199,23 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    Tag
    -
    - Further properties required for a positive result -
    +

    + Further properties required for a positive result +

    is_member_pointer<T,Tag>
    -
    - Predicate value MPL - Integral Constant -
    +

    + Predicate value MPL - + Integral + Constant +

    is_member_pointer<T,Tag>::value
    -
    - Constant boolean value -
    +

    + Constant boolean value +

    @@ -229,17 +242,19 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    is_member_object_pointer<T>
    -
    - Predicate value MPL - Integral Constant -
    +

    + Predicate value MPL - + Integral + Constant +

    is_member_object_pointer<T>::value
    -
    - Constant boolean value -
    +

    + Constant boolean value +

    @@ -266,21 +281,23 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    Tag
    -
    - Further properties required for a positive result -
    +

    + Further properties required for a positive result +

    is_member_function_pointer<T,Tag>
    -
    - Predicate value MPL - Integral Constant -
    +

    + Predicate value MPL - + Integral + Constant +

    is_member_function_pointer<T,Tag>::value
    -
    - Constant boolean value -
    +

    + Constant boolean value +

    @@ -308,23 +325,23 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    Tag
    -
    - Further properties required for a positive result -
    +

    + Further properties required for a positive result +

    is_callable_builtin<T,Tag>
    -
    - Predicate value as MPL - - Integral - Constant -
    +

    + Predicate value as MPL + - Integral + Constant +

    is_callable_builtin<T,Tag>::value
    -
    - Constant boolean value -
    +

    + Constant boolean value +

    @@ -352,23 +369,23 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    Tag
    -
    - Further properties required for a positive result -
    +

    + Further properties required for a positive result +

    is_nonmember_callable_builtin<T,Tag>
    -
    - Predicate value as MPL - - Integral - Constant -
    +

    + Predicate value as MPL + - Integral + Constant +

    is_nonmember_callable_builtin<T,Tag>::value
    -
    - Constant boolean value -
    +

    + Constant boolean value +

    @@ -384,7 +401,7 @@


    diff --git a/doc/html/boost_functiontypes/reference/decomposition.html b/doc/html/boost_functiontypes/reference/decomposition.html index 00f9b32..91ebf50 100644 --- a/doc/html/boost_functiontypes/reference/decomposition.html +++ b/doc/html/boost_functiontypes/reference/decomposition.html @@ -13,10 +13,17 @@ for type synthesis"> -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    @@ -52,13 +59,13 @@

    F
    -
    - Type to analyze -
    +

    + Type to analyze +

    result_type<F>::type
    -
    - Result type of F -
    +

    + Result type of F +

    @@ -88,23 +95,23 @@

    F
    -
    - Type to analyze -
    +

    + Type to analyze +

    ClassTransform
    -
    -MPL - Lambda - Expression to transform the class type if F - is a member function pointer -
    +

    + MPL - Lambda + Expression to transform the class type if F + is a member function pointer +

    parameter_types<F,ClassTransform>
    -
    -MPL - Front - / Back - Extensible - Random - Access Sequence of parameter types -
    +

    + MPL - Front + / Back + Extensible + Random + Access Sequence of parameter types +

    @@ -134,19 +141,19 @@

    F
    -
    - Callable builtin type -
    +

    + Callable builtin type +

    function_arity<F>
    -
    - Function arity as MPL - - Integral - Constant -
    +

    + Function arity as MPL + - Integral + Constant +

    function_arity<F>::value
    -
    - Constant value of the function arity -
    +

    + Constant value of the function arity +

    @@ -179,27 +186,27 @@

    T
    -
    - Type to analyze -
    +

    + Type to analyze +

    ClassTransform
    -
    -MPL - Lambda - Expression to transform the class type if T - is a member function pointer -
    +

    + MPL - Lambda + Expression to transform the class type if T + is a member function pointer +

    components<T,ClassTransform>
    -
    -MPL - Front - / Back - Extensible - Random - Access Sequence of all component types and property tag -
    +

    + MPL - Front + / Back + Extensible + Random + Access Sequence of all component types and property tag +

    components<T,ClassTransform>::types
    -
    - Decorated MPL Sequence, exposed for optimization -
    +

    + Decorated MPL Sequence, exposed for optimization +

    @@ -220,7 +227,7 @@


    diff --git a/doc/html/boost_functiontypes/reference/macros.html b/doc/html/boost_functiontypes/reference/macros.html index adeef85..24c18db 100644 --- a/doc/html/boost_functiontypes/reference/macros.html +++ b/doc/html/boost_functiontypes/reference/macros.html @@ -10,10 +10,17 @@ -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    @@ -233,7 +240,7 @@
    diff --git a/doc/html/boost_functiontypes/reference/synthesis.html b/doc/html/boost_functiontypes/reference/synthesis.html index 975dcf5..367db36 100644 --- a/doc/html/boost_functiontypes/reference/synthesis.html +++ b/doc/html/boost_functiontypes/reference/synthesis.html @@ -12,10 +12,17 @@ -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    @@ -52,19 +59,19 @@

    Types
    -
    - Component types in form of an MPL - - Forward - Sequence or another callable, builtin type -
    +

    + Component types in form of an MPL + - Forward + Sequence or another callable, builtin type +

    Tag
    -
    - Further properties -
    +

    + Further properties +

    function_type<Types,Tag>::type
    -
    - Synthesized type -
    +

    + Synthesized type +

    @@ -95,19 +102,19 @@

    Types
    -
    - Component types in form of an MPL - - Forward - Sequence or another callable, builtin type -
    +

    + Component types in form of an MPL + - Forward + Sequence or another callable, builtin type +

    Tag
    -
    - Further properties -
    +

    + Further properties +

    function_pointer<Types,Tag>::type
    -
    - Synthesized type -
    +

    + Synthesized type +

    @@ -138,19 +145,19 @@

    Types
    -
    - Component types in form of an MPL - - Forward - Sequence or another callable, builtin type -
    +

    + Component types in form of an MPL + - Forward + Sequence or another callable, builtin type +

    Tag
    -
    - Further properties -
    +

    + Further properties +

    function_reference<Types,Tag>::type
    -
    - Synthesized type -
    +

    + Synthesized type +

    @@ -181,19 +188,19 @@

    Types
    -
    - Component types in form of an MPL - - Forward - Sequence or another callable, builtin type -
    +

    + Component types in form of an MPL + - Forward + Sequence or another callable, builtin type +

    Tag
    -
    - Further properties -
    +

    + Further properties +

    member_function_pointer<Types,Tag>::type
    -
    - Synthesized type -
    +

    + Synthesized type +

    @@ -217,7 +224,7 @@


    diff --git a/doc/html/boost_functiontypes/reference/tag_types.html b/doc/html/boost_functiontypes/reference/tag_types.html index 2280b65..eb40aac 100644 --- a/doc/html/boost_functiontypes/reference/tag_types.html +++ b/doc/html/boost_functiontypes/reference/tag_types.html @@ -11,10 +11,17 @@ -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    @@ -286,13 +293,13 @@

    TagN
    -
    - Property tag -
    +

    + Property tag +

    tag<Tag1,Tag2...>
    -
    - Compound property tag -
    +

    + Compound property tag +

    @@ -307,7 +314,7 @@


    diff --git a/doc/html/boost_functiontypes/use_cases.html b/doc/html/boost_functiontypes/use_cases.html index a99b5fd..ab9e332 100644 --- a/doc/html/boost_functiontypes/use_cases.html +++ b/doc/html/boost_functiontypes/use_cases.html @@ -10,10 +10,17 @@ -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    @@ -162,7 +169,7 @@
    diff --git a/doc/html/index.html b/doc/html/index.html index 9d47b78..358b001 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -8,16 +8,26 @@ -
    Boost C++ Libraries
    + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore

    - +
    Next

    Chapter 1. Boost.FunctionTypes 2.5

    +

    +Tobias Schwinger +

    -

    +

    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)

    @@ -36,10 +46,10 @@
    - +

    Last revised: May 13, 2007 at 14:01:00 GMT

    Last revised: May 13, 2007 at 13:12:48 GMT


    - +
    Next
    diff --git a/example/interpreter.hpp b/example/interpreter.hpp index 20e0c2f..9e75bf7 100644 --- a/example/interpreter.hpp +++ b/example/interpreter.hpp @@ -14,11 +14,11 @@ // ========================== // // When a function is registered, an 'invoker' template is instantiated with -// the function's type. The 'invoker' fetches a value from the 'token_parser' +// the function's type. The 'invoker' fetches a value from the 'token_parser' // for each parameter of the function into a tuple and finally invokes the the // function with these values as arguments. The invoker's entrypoint, which // is a function of the callable builtin that describes the function to call and -// a reference to the 'token_parser', is partially bound to the registered +// a reference to the 'token_parser', is partially bound to the registered // function and put into a map so it can be found by name during parsing. #include @@ -36,9 +36,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -58,7 +58,7 @@ namespace example class interpreter { - class token_parser; + class token_parser; typedef boost::function invoker_function; typedef std::map dictionary; @@ -66,7 +66,7 @@ namespace example public: // Registers a function with the interpreter. template - typename boost::enable_if< ft::is_nonmember_callable_builtin + typename boost::enable_if< ft::is_nonmember_callable_builtin >::type register_function(std::string const & name, Function f); // Parse input for functions to call. @@ -76,13 +76,13 @@ namespace example template< typename Function , class From = typename mpl::begin< ft::parameter_types >::type , class To = typename mpl::end< ft::parameter_types >::type - > + > struct invoker; }; class interpreter::token_parser { - typedef boost::token_iterator_generator< + typedef boost::token_iterator_generator< boost::char_separator >::type token_iterator; token_iterator itr_at, itr_to; @@ -101,7 +101,7 @@ namespace example // Returns a token of given type. // We just apply boost::lexical_cast to whitespace separated string tokens // for simplicity. - template + template typename remove_cv_ref::type get() { if (! this->has_more_tokens()) @@ -111,8 +111,8 @@ namespace example { typedef typename remove_cv_ref::type result_type; result_type result = boost::lexical_cast - ::type>(*this->itr_at); - ++this->itr_at; + ::type>(*this->itr_at); + ++this->itr_at; return result; } @@ -129,7 +129,7 @@ namespace example { // add an argument to a Fusion cons-list for each parameter type template - static inline + static inline void apply(Function func, token_parser & parser, Args const & args) { typedef typename mpl::deref::type arg_type; @@ -144,7 +144,7 @@ namespace example { // the argument list is complete, now call the function template - static inline + static inline void apply(Function func, token_parser &, Args const & args) { fusion::invoke(func,args); @@ -156,7 +156,7 @@ namespace example interpreter::register_function(std::string const & name, Function f) { // instantiate and store the invoker by name - this->map_invokers[name] = boost::bind( + this->map_invokers[name] = boost::bind( & invoker::template apply, f,_1,fusion::nil() ); } @@ -177,9 +177,9 @@ namespace example // look up function dictionary::const_iterator entry = map_invokers.find( func_name ); if (entry == map_invokers.end()) - throw std::runtime_error("unknown function: " + func_name); - - // call the invoker which controls argument parsing + throw std::runtime_error("unknown function: " + func_name); + + // call the invoker which controls argument parsing entry->second(parser); } } diff --git a/include/boost/function_types/config/compiler.hpp b/include/boost/function_types/config/compiler.hpp index b9c020f..151c856 100644 --- a/include/boost/function_types/config/compiler.hpp +++ b/include/boost/function_types/config/compiler.hpp @@ -18,33 +18,36 @@ # error "unsupported compiler version" # endif - // enable clrcall calling covention (call to .NET managed code) when - // compiling with /clr -# if BOOST_MSVC >= 1400 && defined(__cplusplus_cli) -# ifndef BOOST_FT_CC_CLRCALL -# define BOOST_FT_CC_CLRCALL callable_builtin -# endif -# endif +# ifdef BOOST_FT_AUTODETECT_CALLING_CONVENTIONS - // Intel x86 architecture specific calling conventions -# ifdef _M_IX86 -# define BOOST_FT_COMMON_X86_CCs callable_builtin -# if BOOST_MSVC < 1400 - // version 7.1 is missing a keyword to specify the thiscall cc ... -# ifndef BOOST_FT_CC_IMPLICIT_THISCALL -# define BOOST_FT_CC_IMPLICIT_THISCALL non_variadic|member|callable_builtin -# ifndef BOOST_FT_CONFIG_OK -# pragma message("INFO| /Gd /Gr /Gz will compiler options will cause") -# pragma message("INFO| a compile error.") -# pragma message("INFO| Reconfigure Boost.FunctionTypes in this case.") -# pragma message("INFO| This message can be suppressed by defining") -# pragma message("INFO| BOOST_FT_CONFIG_OK.") + // enable clrcall calling covention (call to .NET managed code) when + // compiling with /clr +# if BOOST_MSVC >= 1400 && defined(__cplusplus_cli) +# ifndef BOOST_FT_CC_CLRCALL +# define BOOST_FT_CC_CLRCALL callable_builtin # endif -# endif -# else - // ...introduced in version 8 -# ifndef BOOST_FT_CC_THISCALL -# define BOOST_FT_CC_THISCALL non_variadic|member|callable_builtin +# endif + + // Intel x86 architecture specific calling conventions +# ifdef _M_IX86 +# define BOOST_FT_COMMON_X86_CCs callable_builtin +# if BOOST_MSVC < 1400 + // version 7.1 is missing a keyword to specify the thiscall cc ... +# ifndef BOOST_FT_CC_IMPLICIT_THISCALL +# define BOOST_FT_CC_IMPLICIT_THISCALL non_variadic|member|callable_builtin +# ifndef BOOST_FT_CONFIG_OK +# pragma message("INFO| /Gd /Gr /Gz will compiler options will cause") +# pragma message("INFO| a compile error.") +# pragma message("INFO| Reconfigure Boost.FunctionTypes in this case.") +# pragma message("INFO| This message can be suppressed by defining") +# pragma message("INFO| BOOST_FT_CONFIG_OK.") +# endif +# endif +# else + // ...introduced in version 8 +# ifndef BOOST_FT_CC_THISCALL +# define BOOST_FT_CC_THISCALL non_variadic|member|callable_builtin +# endif # endif # endif # endif @@ -55,32 +58,37 @@ # error "unsupported compiler version" # endif -# if defined(__i386__) -# // see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20439 -# // see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29328 -# if BOOST_WORKAROUND(__GNUC__,BOOST_TESTED_AT(4)) -# ifndef BOOST_FT_CC_IMPLICIT -# define BOOST_FT_CC_IMPLICIT member|callable_builtin +# ifdef BOOST_FT_AUTODETECT_CALLING_CONVENTIONS + +# if defined(__i386__) +# // see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20439 +# // see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29328 +# if BOOST_WORKAROUND(__GNUC__,BOOST_TESTED_AT(4)) +# ifndef BOOST_FT_CC_IMPLICIT +# define BOOST_FT_CC_IMPLICIT member|callable_builtin +# endif +# define BOOST_FT_COMMON_X86_CCs non_member|callable_builtin +# else +# define BOOST_FT_COMMON_X86_CCs callable_builtin # endif -# define BOOST_FT_COMMON_X86_CCs non_member|callable_builtin # else -# define BOOST_FT_COMMON_X86_CCs callable_builtin -# endif -# else -# ifndef BOOST_FT_CC_IMPLICIT -# define BOOST_FT_CC_IMPLICIT callable_builtin +# ifndef BOOST_FT_CC_IMPLICIT +# define BOOST_FT_CC_IMPLICIT callable_builtin +# endif # endif # endif -# // TODO: straighten out this hack -# ifndef __cdecl -# define __cdecl __attribute__((__cdecl__)) +# if (defined(BOOST_FT_CC_CDECL) || defined(BOOST_FT_COMMON_X86_CCs)) \ + && !defined(__cdecl) +# define __cdecl __attribute__((__cdecl__)) # endif -# ifndef __stdcall -# define __stdcall __attribute__((__stdcall__)) +# if (defined(BOOST_FT_CC_STDCALL) || defined(BOOST_FT_COMMON_X86_CCs)) \ + && !defined(__stdcall) +# define __stdcall __attribute__((__stdcall__)) # endif -# ifndef __fastcall -# define __fastcall __attribute__((__fastcall__)) +# if (defined(BOOST_FT_CC_FASTCALL) || defined(BOOST_FT_COMMON_X86_CCs)) \ + && !defined(__fastcall) +# define __fastcall __attribute__((__fastcall__)) # endif #elif defined(__BORLANDC__) @@ -91,7 +99,9 @@ # pragma message("WARNING: library untested with this compiler version") # endif -# define BOOST_FT_COMMON_X86_CCs callable_builtin +# ifdef BOOST_FT_AUTODETECT_CALLING_CONVENTIONS +# define BOOST_FT_COMMON_X86_CCs callable_builtin +# endif // syntactic specialities of cc specifier # define BOOST_FT_SYNTAX(result,lparen,cc_spec,type_mod,name,rparen) \ diff --git a/include/boost/function_types/detail/pp_cc_loop/master.hpp b/include/boost/function_types/detail/pp_cc_loop/master.hpp index 49ffded..5a6d6c4 100644 --- a/include/boost/function_types/detail/pp_cc_loop/master.hpp +++ b/include/boost/function_types/detail/pp_cc_loop/master.hpp @@ -37,6 +37,37 @@ # define BOOST_PP_ITERATION_LIMITS \ (0,BOOST_PP_SEQ_SIZE(BOOST_FT_CC_NAMES_SEQ)-1) # include BOOST_PP_ITERATE() +# if !defined(BOOST_FT_config_valid) && BOOST_FT_CC_PREPROCESSING +# define BOOST_FT_cc_id 1 +# define BOOST_FT_cc_name implicit_cc +# define BOOST_FT_cc BOOST_PP_EMPTY +# define BOOST_FT_cond callable_builtin +# include BOOST_PP_EXPAND ( ) +# undef BOOST_FT_cond +# undef BOOST_FT_cc_name +# undef BOOST_FT_cc +# undef BOOST_FT_cc_id +# elif !defined(BOOST_FT_config_valid) // and generating preprocessed file +BOOST_PP_EXPAND(#) ifndef BOOST_FT_config_valid +BOOST_PP_EXPAND(#) define BOOST_FT_cc_id 1 +BOOST_PP_EXPAND(#) define BOOST_FT_cc_name implicit_cc +BOOST_PP_EXPAND(#) define BOOST_FT_cc BOOST_PP_EMPTY +BOOST_PP_EXPAND(#) define BOOST_FT_cond callable_builtin +#define _() +BOOST_PP_EXPAND(#) include BOOST_PP_EXPAND _()( ) +#undef _ +BOOST_PP_EXPAND(#) undef BOOST_FT_cond +BOOST_PP_EXPAND(#) undef BOOST_FT_cc_name +BOOST_PP_EXPAND(#) undef BOOST_FT_cc +BOOST_PP_EXPAND(#) undef BOOST_FT_cc_id +BOOST_PP_EXPAND(#) else +BOOST_PP_EXPAND(#) undef BOOST_FT_config_valid +BOOST_PP_EXPAND(#) endif + +# else +# undef BOOST_FT_config_valid +# endif + # include # include @@ -53,6 +84,7 @@ # define BOOST_FT_cond BOOST_PP_CAT(BOOST_FT_CC_,BOOST_FT_cc_pp_name) # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND() # endif @@ -87,6 +119,7 @@ BOOST_PP_EXPAND(#) define BOOST_FT_cond BOOST_FT_cc_cond_v # undef BOOST_FT_cc_inf BOOST_PP_EXPAND(#) if BOOST_FT_cond +BOOST_PP_EXPAND(#) define BOOST_FT_config_valid 1 #define _() BOOST_PP_EXPAND(#) include BOOST_PP_EXPAND _()() #undef _ diff --git a/include/boost/function_types/detail/pp_cc_loop/preprocessed.hpp b/include/boost/function_types/detail/pp_cc_loop/preprocessed.hpp index 598de8a..87c6031 100644 --- a/include/boost/function_types/detail/pp_cc_loop/preprocessed.hpp +++ b/include/boost/function_types/detail/pp_cc_loop/preprocessed.hpp @@ -14,6 +14,7 @@ # define BOOST_FT_cc BOOST_PP_EMPTY # define BOOST_FT_cond BOOST_FT_CC_IMPLICIT # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND ( ) # endif # undef BOOST_FT_cond @@ -25,6 +26,7 @@ # define BOOST_FT_cc BOOST_PP_IDENTITY(__cdecl ) # define BOOST_FT_cond BOOST_FT_CC_CDECL # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND ( ) # endif # undef BOOST_FT_cond @@ -36,6 +38,7 @@ # define BOOST_FT_cc BOOST_PP_IDENTITY(__stdcall ) # define BOOST_FT_cond BOOST_FT_CC_STDCALL # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND ( ) # endif # undef BOOST_FT_cond @@ -47,6 +50,7 @@ # define BOOST_FT_cc BOOST_PP_IDENTITY(pascal ) # define BOOST_FT_cond BOOST_FT_CC_PASCAL # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND ( ) # endif # undef BOOST_FT_cond @@ -58,6 +62,7 @@ # define BOOST_FT_cc BOOST_PP_IDENTITY(__fastcall) # define BOOST_FT_cond BOOST_FT_CC_FASTCALL # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND ( ) # endif # undef BOOST_FT_cond @@ -69,6 +74,7 @@ # define BOOST_FT_cc BOOST_PP_IDENTITY(__clrcall ) # define BOOST_FT_cond BOOST_FT_CC_CLRCALL # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND ( ) # endif # undef BOOST_FT_cond @@ -80,6 +86,7 @@ # define BOOST_FT_cc BOOST_PP_IDENTITY(__thiscall) # define BOOST_FT_cond BOOST_FT_CC_THISCALL # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND ( ) # endif # undef BOOST_FT_cond @@ -91,9 +98,23 @@ # define BOOST_FT_cc BOOST_PP_EMPTY # define BOOST_FT_cond BOOST_FT_CC_IMPLICIT_THISCALL # if BOOST_FT_cond +# define BOOST_FT_config_valid 1 # include BOOST_PP_EXPAND ( ) # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name # undef BOOST_FT_cc # undef BOOST_FT_cc_id +# ifndef BOOST_FT_config_valid +# define BOOST_FT_cc_id 1 +# define BOOST_FT_cc_name implicit_cc +# define BOOST_FT_cc BOOST_PP_EMPTY +# define BOOST_FT_cond 0x00000001 +# include BOOST_PP_EXPAND ( ) +# undef BOOST_FT_cond +# undef BOOST_FT_cc_name +# undef BOOST_FT_cc +# undef BOOST_FT_cc_id +# else +# undef BOOST_FT_config_valid +# endif diff --git a/index.html b/index.html new file mode 100644 index 0000000..ee4ce6e --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + + + + + +

    Automatic redirection failed, please go to + doc/html/index.html.

    +

    Copyright Tobias Schwinger 2005-2007

    +

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

    + + + diff --git a/test/custom_ccs/member_ccs.cpp b/test/custom_ccs/member_ccs.cpp index 28e0c1a..727b38b 100644 --- a/test/custom_ccs/member_ccs.cpp +++ b/test/custom_ccs/member_ccs.cpp @@ -6,11 +6,17 @@ //------------------------------------------------------------------------------ +#define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS + #include #include #include #include +#ifndef BOOST_FT_CC_STDCALL +# error "test not supported with this compiler" +#endif + namespace ft = boost::function_types; namespace mpl = boost::mpl; diff --git a/test/custom_ccs/member_ccs_exact.cpp b/test/custom_ccs/member_ccs_exact.cpp index 381f69f..2decf14 100644 --- a/test/custom_ccs/member_ccs_exact.cpp +++ b/test/custom_ccs/member_ccs_exact.cpp @@ -6,11 +6,17 @@ //------------------------------------------------------------------------------ +#define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS + #include #include #include #include +#ifndef BOOST_FT_CC_STDCALL +# error "test not supported with this compiler" +#endif + namespace ft = boost::function_types; namespace mpl = boost::mpl; diff --git a/test/custom_ccs/nonmember_ccs.cpp b/test/custom_ccs/nonmember_ccs.cpp index 18a73ff..98bf3d5 100644 --- a/test/custom_ccs/nonmember_ccs.cpp +++ b/test/custom_ccs/nonmember_ccs.cpp @@ -6,6 +6,8 @@ //------------------------------------------------------------------------------ +#define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS + #include #include #include @@ -13,6 +15,10 @@ #include #include +#ifndef BOOST_FT_CC_STDCALL +# error "test not supported with this compiler" +#endif + namespace ft = boost::function_types; namespace mpl = boost::mpl; diff --git a/test/custom_ccs/nonmember_ccs_exact.cpp b/test/custom_ccs/nonmember_ccs_exact.cpp index 808ded3..31f73c0 100644 --- a/test/custom_ccs/nonmember_ccs_exact.cpp +++ b/test/custom_ccs/nonmember_ccs_exact.cpp @@ -6,6 +6,8 @@ //------------------------------------------------------------------------------ +#define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS + #include #include #include @@ -13,6 +15,10 @@ #include #include +#ifndef BOOST_FT_CC_STDCALL +# error "test not supported with this compiler" +#endif + namespace ft = boost::function_types; namespace mpl = boost::mpl; diff --git a/test/decomposition/parameter_types.cpp b/test/decomposition/parameter_types.cpp index 9255ca9..5feb1a8 100644 --- a/test/decomposition/parameter_types.cpp +++ b/test/decomposition/parameter_types.cpp @@ -24,7 +24,7 @@ typedef C (C::*mem_func_ptr)(C,int); typedef C (C::*c_mem_func_ptr)(C,C) const; typedef C (C::*v_mem_func_ptr)(C) volatile; typedef C (C::*cv_mem_func_ptr)() const volatile; - +typedef C C::*mem_ptr; BOOST_MPL_ASSERT(( mpl::equal< ft::parameter_types, mpl::vector > @@ -54,3 +54,6 @@ BOOST_MPL_ASSERT(( mpl::equal< ft::parameter_types, mpl::vector > )); +BOOST_MPL_ASSERT(( + mpl::equal< ft::parameter_types, mpl::vector > +));