diff --git a/build/Jamfile b/build/Jamfile index ce5fb17..bace553 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -2,7 +2,7 @@ # (C) Copyright Tobias Schwinger # # Use modification and distribution are subject to the boost Software License, -# Version 1.0. (See http:/\/www.boost.org/LICENSE_1_0.txt). +# Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). # Generates preprocessed files with wave. @@ -13,18 +13,24 @@ rule wave actions wave { - $(BOOST_ROOT)/dist/bin/wave -S$(BOOST_ROOT) $(>) -o $(<) + ../../../dist/bin/wave -S../../.. $(>) -o $(<) } -make $(BOOST_ROOT)/libs/function_types/build/timestamps/arity_loops +make ../../../libs/function_types/build/timestamps/arity_loops : preprocess_arity_loops.cpp : wave ; -make $(BOOST_ROOT)/libs/function_types/build/timestamps/encoding +explicit ../../../libs/function_types/build/timestamps/arity_loops ; + +make ../../../libs/function_types/build/timestamps/encoding : preprocess_encoding.cpp : wave ; -make $(BOOST_ROOT)/libs/function_types/build/timestamps/cc_names +explicit ../../../libs/function_types/build/timestamps/encoding ; + +make ../../../libs/function_types/build/timestamps/cc_names : preprocess_cc_names.cpp : wave ; +explicit ../../../libs/function_types/build/timestamps/cc_names ; + diff --git a/build/preprocess_arity_loops.cpp b/build/preprocess_arity_loops.cpp index a045e9f..d39b65c 100644 --- a/build/preprocess_arity_loops.cpp +++ b/build/preprocess_arity_loops.cpp @@ -2,7 +2,7 @@ // (C) Copyright Tobias Schwinger // // Use modification and distribution are subject to the boost Software License, -// Version 1.0. (See http:/\/www.boost.org/LICENSE_1_0.txt). +// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). //------------------------------------------------------------------------------ diff --git a/build/preprocess_cc_names.cpp b/build/preprocess_cc_names.cpp index 39d77c5..803667c 100644 --- a/build/preprocess_cc_names.cpp +++ b/build/preprocess_cc_names.cpp @@ -2,7 +2,7 @@ // (C) Copyright Tobias Schwinger // // Use modification and distribution are subject to the boost Software License, -// Version 1.0. (See http:/\/www.boost.org/LICENSE_1_0.txt). +// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). //------------------------------------------------------------------------------ diff --git a/build/preprocess_encoding.cpp b/build/preprocess_encoding.cpp index e2e4a5e..886bec3 100644 --- a/build/preprocess_encoding.cpp +++ b/build/preprocess_encoding.cpp @@ -2,7 +2,7 @@ // (C) Copyright Tobias Schwinger // // Use modification and distribution are subject to the boost Software License, -// Version 1.0. (See http:/\/www.boost.org/LICENSE_1_0.txt). +// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). //------------------------------------------------------------------------------ diff --git a/build/timestamps/cc_names b/build/timestamps/cc_names index e33ac14..f91091c 100644 --- a/build/timestamps/cc_names +++ b/build/timestamps/cc_names @@ -1,2 +1 @@ timestamp file - diff --git a/doc/Jamfile b/doc/Jamfile index 5b46953..fc28d86 100644 --- a/doc/Jamfile +++ b/doc/Jamfile @@ -2,7 +2,7 @@ # (C) Copyright Tobias Schwinger # # Use modification and distribution are subject to the boost Software License, -# Version 1.0. (See http:/\/www.boost.org/LICENSE_1_0.txt). +# Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). using quickbook ; @@ -13,6 +13,7 @@ boostbook standalone : boost.root=../../../.. boost.libraries=../../../libraries.htm + html.stylesheet=../../../../doc/html/boostbook.css 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 0f989ae..2d97d32 100644 --- a/doc/function_types.qbk +++ b/doc/function_types.qbk @@ -1099,6 +1099,7 @@ library in one or the other way: * Jonathan Turkanis * Pavel Vozenilek * Steven Watanabe +* K. Noel Belcourt [endsect] diff --git a/doc/html/boost_functiontypes/about_tag_types.html b/doc/html/boost_functiontypes/about_tag_types.html index 2cf1396..d16c916 100644 --- a/doc/html/boost_functiontypes/about_tag_types.html +++ b/doc/html/boost_functiontypes/about_tag_types.html @@ -1,21 +1,21 @@ -About Tag Types - - + About Tag Types + + - - + + - + - - + +
Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

@@ -24,8 +24,7 @@

Boost.FunctionTypes uses tag types to encode properties that are not types per se, such as calling convention or whether a function is variadic or cv- @@ -85,11 +84,7 @@ - +
Copyright © 2004 -2007 Tobias Schwinger


diff --git a/doc/html/boost_functiontypes/acknowledgements.html b/doc/html/boost_functiontypes/acknowledgements.html index 7a2e1f3..414b34e 100644 --- a/doc/html/boost_functiontypes/acknowledgements.html +++ b/doc/html/boost_functiontypes/acknowledgements.html @@ -1,20 +1,20 @@ -Acknowledgements - - + Acknowledgements + + - + - + - - + +
Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

@@ -23,8 +23,7 @@

Thanks go to the following people for supporting the development of this library in one or the other way: @@ -72,15 +71,14 @@

  • Steven Watanabe
  • +
  • + K. Noel Belcourt +
  • - +
    Copyright © 2004 -2007 Tobias Schwinger

    diff --git a/doc/html/boost_functiontypes/introduction.html b/doc/html/boost_functiontypes/introduction.html index 306b3c8..8287622 100644 --- a/doc/html/boost_functiontypes/introduction.html +++ b/doc/html/boost_functiontypes/introduction.html @@ -1,21 +1,21 @@ -Introduction - - + Introduction + + - + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,8 +24,7 @@

    Boost.FunctionTypes provides functionality to classify, decompose and synthesize function, function pointer, function reference and pointer to member types. @@ -57,34 +56,35 @@ constant called value.

    -is_function_pointer< bool(*)(int) >::value // == true 
    +is_function_pointer< bool(*)(int) >::value // == true 
     
    -function_arity< bool(*)(int) >::value // == 1
    +function_arity< bool(*)(int) >::value // == 1
     

    Templates that encapsulate properties that are single types contain a type member called type.

    -function_type< mpl::vector<bool,int> >::type // is bool(int)
    +function_type< mpl::vector<bool,int> >::type // is bool(int)
     
    -result_type< bool(&)(int) >::type // is bool
    +result_type< bool(&)(int) >::type // is bool
     

    Templates that encapsulate properties that are type lists model an MPL-compatible type sequence.

    -parameter_types< bool(int) > // models an MPL sequence
    +parameter_types< bool(int) > // models an MPL sequence
     
    - +
    Copyright © 2004 -2007 Tobias Schwinger

    diff --git a/doc/html/boost_functiontypes/rationale.html b/doc/html/boost_functiontypes/rationale.html index e2a1952..475a795 100644 --- a/doc/html/boost_functiontypes/rationale.html +++ b/doc/html/boost_functiontypes/rationale.html @@ -1,21 +1,21 @@ -Rationale - - + Rationale + + - - + + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,13 +24,12 @@
    +

    + + Error handling rationale -

    +

    The library does not define the required members of class templates in case of an error. This technique causes the compiler to stop displaying diagnostics @@ -41,10 +40,10 @@ The library's components have limited error conditions, so problematic input can be spotted easily.

    -

    - - Why MPL Sequences? -

    +

    + + Why MPL Sequences? +

    MPL provides algorithms on Sequences, so transformations (such as turning by-value parameter types into const references for optimized forwarding or computing @@ -54,20 +53,20 @@ other Boost libraries (most importantly Fusion), so another reason is interoperability.

    -

    - - Pointer +

    + + Pointer to member object types -

    +

    Despite their syntax, pointer to member object types can be seen as dereferencing functionals.

    -

    - - The +

    + + The ClassTransform template parameter -

    +

    This-pointer, this-reference or just the object (or maybe even a smart pointer to the object) plus adjustments of @@ -80,10 +79,10 @@ client to adjust the class type before the sequence is formed and then treat all parameters uniformly.

    -

    - - Why tag types? -

    +

    + + Why tag types? +

    Let's consider the alternatives.

    @@ -99,12 +98,12 @@ parameters do not work within MPL lambda expressions and can cause problems with older compilers.

    -

    - - Is +

    + + Is it safe to have the synthesis templates take a callable builtin type or an MPL sequence as the first template argument? -

    +

    Yes, but it isn't immediately obvious as the set of possible MPL sequences isn't inherently disjoint from the set of callable builtin types. @@ -114,23 +113,25 @@ idea, because builtin types are accessible before the headers that make the type a sequence have been included, which can easily violate the ODR.

    -

    - - Why +

    + + Why does the hidden this parameter count for the function arity of member functions? -

    +

    It was found preferable that the following condition holds:

    -mpl::size< parameter_types<T> >::value == function_arity<T>::value
    +mpl::size< parameter_types<T> >::value == function_arity<T>::value
     
    -

    - - Why +

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

    +

    A cv-qualified pointer is still a pointer. It usually doesn't matter and even if it does, it's a job for Boost.TypeTraits. @@ -138,11 +139,7 @@ - +
    Copyright © 2004 -2007 Tobias Schwinger


    diff --git a/doc/html/boost_functiontypes/reference.html b/doc/html/boost_functiontypes/reference.html index b3c6048..91fe6f3 100644 --- a/doc/html/boost_functiontypes/reference.html +++ b/doc/html/boost_functiontypes/reference.html @@ -1,21 +1,22 @@ -Reference - - + Reference + + - - + + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,8 +25,7 @@
    - +
    Copyright © 2004 -2007 Tobias Schwinger

    diff --git a/doc/html/boost_functiontypes/reference/classification.html b/doc/html/boost_functiontypes/reference/classification.html index e891c9c..699dae9 100644 --- a/doc/html/boost_functiontypes/reference/classification.html +++ b/doc/html/boost_functiontypes/reference/classification.html @@ -1,21 +1,23 @@ -Class templates for type classification - - + Class + templates for type classification + + - - - + + + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,9 +26,9 @@
    is_function
    @@ -47,11 +49,12 @@
    -template<typename T, typename Tag = null_tag>
    +template<typename T, typename Tag = null_tag>
     struct is_function;
     

    @@ -90,11 +93,12 @@

    -template<typename T, typename Tag = null_tag>
    +template<typename T, typename Tag = null_tag>
     struct is_function_pointer;
     

    @@ -133,11 +137,12 @@

    -template<typename T, typename Tag = null_tag>
    +template<typename T, typename Tag = null_tag>
     struct is_function_reference;
     

    @@ -176,11 +181,12 @@

    -template<typename T, typename Tag = null_tag>
    +template<typename T, typename Tag = null_tag>
     struct is_member_pointer;
     

    @@ -219,9 +225,9 @@

     template<typename T>
     struct is_member_object_pointer;
    @@ -257,11 +263,12 @@
     
     
     
    -template<typename T, typename Tag = null_tag>
    +template<typename T, typename Tag = null_tag>
     struct is_member_function_pointer;
     

    @@ -300,11 +307,12 @@

    -template<typename T, typename Tag = null_tag>
    +template<typename T, typename Tag = null_tag>
     struct is_callable_builtin;
     

    @@ -343,11 +351,12 @@

    -template<typename T, typename Tag = null_tag>
    +template<typename T, typename Tag = null_tag>
     struct is_nonmember_callable_builtin;
     

    @@ -388,11 +397,7 @@ - +
    Copyright © 2004 -2007 Tobias Schwinger


    diff --git a/doc/html/boost_functiontypes/reference/decomposition.html b/doc/html/boost_functiontypes/reference/decomposition.html index 47a01a3..bb1b431 100644 --- a/doc/html/boost_functiontypes/reference/decomposition.html +++ b/doc/html/boost_functiontypes/reference/decomposition.html @@ -1,21 +1,24 @@ -Class templates for type decomposition - - + Class templates + for type decomposition + + - - - + + + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,9 +27,9 @@
    result_type
    @@ -39,9 +42,9 @@
     template<typename F>
     struct result_type;
    @@ -75,9 +78,9 @@
     
     
     
     template<typename F, class ClassTransform = add_reference<_> >
     struct parameter_types;
    @@ -121,9 +124,9 @@
     
     
     
     template<typename F>
     struct function_arity;
    @@ -166,9 +169,9 @@
     
     
     
     template<typename T, class ClassTransform = add_reference<_> >
     struct components;
    @@ -213,17 +216,14 @@
             

    If T is no callable builtin type, the component types - are an empty sequence and the Tag's meaning is equivalent to the null_tag. + are an empty sequence and the Tag's meaning is equivalent to the null_tag.

    - +
    Copyright © 2004 -2007 Tobias Schwinger

    diff --git a/doc/html/boost_functiontypes/reference/macros.html b/doc/html/boost_functiontypes/reference/macros.html index c1a646b..48cfda6 100644 --- a/doc/html/boost_functiontypes/reference/macros.html +++ b/doc/html/boost_functiontypes/reference/macros.html @@ -1,21 +1,21 @@ -Macros - - + Macros + + - - - + + + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,8 +24,7 @@
    BOOST_FT_MAX_ARITY
    @@ -48,9 +47,9 @@

    Expands to a numeric value that describes the maximum function arity supported by the library. @@ -67,16 +66,17 @@

    Expands to a sequence of ternary tuples (these data types are defined in the documentation of the Boost Preprocessor library). Each sequence element describes one calling convention specifier. The first element in each tuple is the - macro suffix for BOOST_FT_CC_*, + macro suffix for BOOST_FT_CC_*, the second element is the name of the tag that describes the calling convention and the third is the name of the specifier. The specifier is allowed to be an empty string, so the third tuple element is either BOOST_PP_EMPTY @@ -106,13 +106,15 @@

    Enables a specific calling convention. * dentoes the macro suffix, as defined - by BOOST_FT_CC_NAMES - or BOOST_FT_BUILTIN_CC_NAMES. + by BOOST_FT_CC_NAMES + or BOOST_FT_BUILTIN_CC_NAMES.

    The macro expands to a list of restrictions, separated by the | @@ -147,9 +149,9 @@

    Defining this macro causes the following macros to be defined, if not defined already: @@ -162,9 +164,9 @@

    This macro allows to change the syntax of callable builtin types. It is useful to handle the compiler specific placement of the calling convention @@ -180,9 +182,9 @@

    Set to void for compilers that insist on a void parameter for nullary function types, empty by default. @@ -190,9 +192,9 @@

    Disables support for cv-qualified function types. Cv-qualified function types are illegal by the current standard version, but there is a pending @@ -207,9 +209,9 @@

    Makes the compiler preprocess as much as possible of the library code (rather than loading already-preprocessed header files) if defined. @@ -217,27 +219,24 @@

    Makes the compiler preprocess the loop over possible names for custom calling conventions (rather than loading an already-preprocessed header file) if defined.

    - This macro is defined automatically if BOOST_FT_CC_NAMES + This macro is defined automatically if BOOST_FT_CC_NAMES has been defined.

    - +
    Copyright © 2004 -2007 Tobias Schwinger

    diff --git a/doc/html/boost_functiontypes/reference/synthesis.html b/doc/html/boost_functiontypes/reference/synthesis.html index f0721f1..f1bed9f 100644 --- a/doc/html/boost_functiontypes/reference/synthesis.html +++ b/doc/html/boost_functiontypes/reference/synthesis.html @@ -1,21 +1,23 @@ -Class templates for type synthesis - - + Class templates + for type synthesis + + - - - + + + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,9 +26,9 @@
    function_type
    @@ -39,11 +41,12 @@
    -template<typename Types, typename Tag = null_tag> 
    +template<typename Types, typename Tag = null_tag> 
     struct function_type;
     

    @@ -81,11 +84,12 @@

    -template<typename Types, typename Tag = null_tag> 
    +template<typename Types, typename Tag = null_tag> 
     struct function_pointer;
     

    @@ -123,11 +127,12 @@

    -template<typename Types, typename Tag = null_tag> 
    +template<typename Types, typename Tag = null_tag> 
     struct function_reference;
     

    @@ -165,11 +170,12 @@

    -template<typename Types, typename Tag = null_tag> 
    +template<typename Types, typename Tag = null_tag> 
     struct member_function_pointer;
     

    @@ -214,11 +220,7 @@ - +
    Copyright © 2004 -2007 Tobias Schwinger


    diff --git a/doc/html/boost_functiontypes/reference/tag_types.html b/doc/html/boost_functiontypes/reference/tag_types.html index 7c8d437..955296b 100644 --- a/doc/html/boost_functiontypes/reference/tag_types.html +++ b/doc/html/boost_functiontypes/reference/tag_types.html @@ -1,21 +1,22 @@ -Tag Types - - + Tag Types + + - - - + + + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,8 +25,7 @@
    variadic
    @@ -54,9 +54,9 @@
     typedef unspecified variadic;
     
    @@ -73,9 +73,9 @@
     typedef unspecified non_variadic;
     
    @@ -91,9 +91,9 @@
     typedef unspecified default_cc;
     
    @@ -109,9 +109,9 @@
     typedef unspecified const_qualified;
     
    @@ -127,9 +127,9 @@
     typedef unspecified non_const;
     
    @@ -145,9 +145,9 @@
     typedef unspecified volatile_qualified;
     
    @@ -163,9 +163,9 @@
     typedef unspecified non_volatile;
     
    @@ -181,8 +181,7 @@
     typedef unspecified non_cv;
     
    @@ -200,9 +199,9 @@
     typedef unspecified const_non_volatile;
     
    @@ -220,9 +219,9 @@
     typedef unspecified volatile_non_const;
     
    @@ -240,9 +239,9 @@
     typedef unspecified cv_qualified;
     
    @@ -260,9 +259,9 @@
     typedef unspecified null_tag;
     
    @@ -278,8 +277,7 @@

    - tag -

    + tag
     template<class Tag1, class Tag2, 
         class Tag3 = null_tag, class Tag4 = null_tag>
    @@ -312,11 +310,7 @@
     
     
    -
    +
    Copyright © 2004 -2007 Tobias Schwinger

    diff --git a/doc/html/boost_functiontypes/use_cases.html b/doc/html/boost_functiontypes/use_cases.html index b28561d..803b994 100644 --- a/doc/html/boost_functiontypes/use_cases.html +++ b/doc/html/boost_functiontypes/use_cases.html @@ -1,21 +1,21 @@ -Use Cases - - + Use Cases + + - - + + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -24,8 +24,7 @@

    Generic libraries that accept callable arguments are common in C++. Accepting a callable argument of builin type often involves a lot of repetitive code @@ -144,7 +143,8 @@ arguments from a type sequence in a single expression:

    -static_cast<function_pointer<Seq>::type>(& overloaded)
    +static_cast<function_pointer<Seq>::type>(& overloaded)
     

    This technique can be occasionally more flexible than template argument deduction @@ -165,11 +165,7 @@ - +
    Copyright © 2004 -2007 Tobias Schwinger


    diff --git a/doc/html/index.html b/doc/html/index.html index ec2fb41..2f32aa2 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -2,18 +2,18 @@ Chapter 1. Boost.FunctionTypes 2.5 - - + + - + - + - - + +
    Boost C++ LibrariesHomeHome LibrariesPeopleFAQPeopleFAQ More

    @@ -27,7 +27,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)

    @@ -46,8 +46,8 @@
    - - + +

    Last revised: November 25, 2007 at 18:38:02 +0000

    Last revised: November 05, 2007 at 18:24:58 +0100


    Next
    diff --git a/example/fast_mem_fn_example.cpp b/example/fast_mem_fn_example.cpp index efe66a1..381ee14 100644 --- a/example/fast_mem_fn_example.cpp +++ b/example/fast_mem_fn_example.cpp @@ -101,7 +101,11 @@ int main() setup_test(v); t.restart(); +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1400) do_test(v, BOOST_EXAMPLE_FAST_MEM_FN(& test::id)); +#else // MSVC<8 does not like the implementation of the deduction macro: + do_test(v, ::example::fast_mem_fn< int (test::*)() const, & test::id >()); +#endif time1 = t.elapsed(); std::cout << "fast_mem_fn | " << time1 << std::endl; diff --git a/example/interface_example.cpp b/example/interface_example.cpp index d4f66bb..6b7f8d9 100644 --- a/example/interface_example.cpp +++ b/example/interface_example.cpp @@ -8,6 +8,7 @@ // See interface.hpp in this directory for details. #include +#include #include "interface.hpp" diff --git a/example/interpreter.hpp b/example/interpreter.hpp index 9e75bf7..72cd78b 100644 --- a/example/interpreter.hpp +++ b/example/interpreter.hpp @@ -133,8 +133,9 @@ namespace example void apply(Function func, token_parser & parser, Args const & args) { typedef typename mpl::deref::type arg_type; + typedef typename mpl::next::type next_iter_type; - invoker::type, To>::apply + interpreter::invoker::apply ( func, parser, fusion::push_back(args, parser.get()) ); } }; diff --git a/include/boost/function_types/components.hpp b/include/boost/function_types/components.hpp index b975307..a4432c5 100644 --- a/include/boost/function_types/components.hpp +++ b/include/boost/function_types/components.hpp @@ -120,13 +120,14 @@ namespace boost template < typename Components , typename IfTagged - , typename ThenTag + , typename ThenTag + , typename DefaultBase = components_non_func_base > struct retagged_if : mpl::if_ < detail::represents_impl , detail::changed_tag - , components_non_func_base + , DefaultBase >::type { }; @@ -213,14 +214,71 @@ namespace boost : components_impl { }; -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x565)) + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_result + { typedef T const & type; }; + + template + struct member_obj_ptr_result + { typedef T volatile & type; }; + + template + struct member_obj_ptr_result + { typedef T const volatile & type; }; + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_components + : member_object_pointer_base + { + typedef function_types::components type; + typedef components_mpl_sequence_tag tag; + + typedef mpl::integral_c function_arity; + + typedef mpl::vector2< typename detail::member_obj_ptr_result::type, + typename detail::class_transform::type > types; + }; + +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x565)) +# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer + + template + struct components_impl + : member_obj_ptr_components + { }; + +#else +# define BOOST_FT_variations BOOST_FT_pointer + // This workaround removes the member pointer from the type to allow // detection of member function pointers with BCC. template struct components_impl : detail::retagged_if < detail::components_impl::type *, L> - , pointer_tag, /* --> */ member_pointer_tag > + , pointer_tag, /* --> */ member_function_pointer_tag + , member_obj_ptr_components > { }; // BCC lets us test the cv-qualification of a function type by template @@ -349,65 +407,13 @@ namespace boost struct components_bcc : mpl::if_ < detail::represents_impl< detail::components_impl - , member_pointer_tag> + , member_function_pointer_tag> , detail::mfp_components,T,OrigT,L> , detail::components_impl >::type { }; -// TODO: add data member support for Borland - -# define BOOST_FT_variations BOOST_FT_pointer -#else // end of BORLAND WORKAROUND -# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer - - template - struct member_obj_ptr_result - { typedef T & type; }; - - template - struct member_obj_ptr_result - { typedef T const & type; }; - - template - struct member_obj_ptr_result - { typedef T volatile & type; }; - - template - struct member_obj_ptr_result - { typedef T const volatile & type; }; - - template - struct member_obj_ptr_result - { typedef T & type; }; - - template - struct member_obj_ptr_result - { typedef T & type; }; - - template - struct member_obj_ptr_result - { typedef T & type; }; - - template - struct member_obj_ptr_result - { typedef T & type; }; - - - template - struct components_impl - : member_object_pointer_base - { - typedef function_types::components type; - typedef components_mpl_sequence_tag tag; - - typedef mpl::integral_c function_arity; - - typedef mpl::vector2< typename detail::member_obj_ptr_result::type, - typename detail::class_transform::type > types; - }; - -#endif +#endif // end of BORLAND WORKAROUND #define BOOST_FT_al_path boost/function_types/detail/components_impl #include diff --git a/include/boost/function_types/detail/cv_traits.hpp b/include/boost/function_types/detail/cv_traits.hpp index b48452d..242f45b 100644 --- a/include/boost/function_types/detail/cv_traits.hpp +++ b/include/boost/function_types/detail/cv_traits.hpp @@ -12,7 +12,8 @@ #include #include -#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + || BOOST_WORKAROUND(__BORLANDC__, <= 0x582) # include # include # include @@ -22,10 +23,8 @@ namespace boost { namespace function_types { namespace detail { -namespace ft = boost::function_types; - - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if ! (defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + || BOOST_WORKAROUND(__BORLANDC__, <= 0x582)) template struct cv_traits { typedef non_cv tag; typedef T type; }; @@ -109,12 +108,13 @@ struct cv_code { static T _t; BOOST_STATIC_CONSTANT(std::size_t, value = - sizeof(ft::detail::switch_cv(ft::detail::ref_to_ptr(_t) ) )); + sizeof(::boost::function_types::detail::switch_cv( + ::boost::function_types::detail::ref_to_ptr(_t) ) )); }; template struct cv_traits { - typedef typename ft::detail::cv_tag_impl< + typedef typename boost::function_types::detail::cv_tag_impl< ::boost::function_types::detail::cv_code::value >::type tag; diff --git a/include/boost/function_types/detail/pp_arity_loop.hpp b/include/boost/function_types/detail/pp_arity_loop.hpp index 91dfb7c..b6dbff5 100644 --- a/include/boost/function_types/detail/pp_arity_loop.hpp +++ b/include/boost/function_types/detail/pp_arity_loop.hpp @@ -81,14 +81,16 @@ BOOST_PP_EXPAND(#) include BOOST_FT_AL_PREPROCESSED # include # endif +# define BOOST_FT_AL_INCLUDE_FILE + # define BOOST_FT_ARITY_LOOP_PREFIX 1 -# include BOOST_PP_EXPAND() +# include BOOST_FT_AL_INCLUDE_FILE # undef BOOST_FT_ARITY_LOOP_PREFIX # if !BOOST_PP_IS_ITERATING -# define BOOST_PP_FILENAME_1 +# define BOOST_PP_FILENAME_1 BOOST_FT_AL_INCLUDE_FILE # elif BOOST_PP_ITERATION_DEPTH() == 1 -# define BOOST_PP_FILENAME_2 +# define BOOST_PP_FILENAME_2 BOOST_FT_AL_INCLUDE_FILE # else # error "loops nested too deeply" # endif @@ -133,8 +135,10 @@ BOOST_PP_EXPAND(#) include BOOST_FT_AL_PREPROCESSED # undef BOOST_FT_type # define BOOST_FT_ARITY_LOOP_SUFFIX 1 -# include BOOST_PP_EXPAND() +# include BOOST_FT_AL_INCLUDE_FILE # undef BOOST_FT_ARITY_LOOP_SUFFIX + +# undef BOOST_FT_AL_INCLUDE_FILE # endif # undef BOOST_FT_FROM_ARITY 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 5a6d6c4..60e958c 100644 --- a/include/boost/function_types/detail/pp_cc_loop/master.hpp +++ b/include/boost/function_types/detail/pp_cc_loop/master.hpp @@ -42,7 +42,7 @@ # define BOOST_FT_cc_name implicit_cc # define BOOST_FT_cc BOOST_PP_EMPTY # define BOOST_FT_cond callable_builtin -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # undef BOOST_FT_cond # undef BOOST_FT_cc_name # undef BOOST_FT_cc @@ -54,7 +54,7 @@ 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 _()( ) +BOOST_PP_EXPAND(#) include BOOST_FT_cc_file #undef _ BOOST_PP_EXPAND(#) undef BOOST_FT_cond BOOST_PP_EXPAND(#) undef BOOST_FT_cc_name @@ -85,7 +85,7 @@ BOOST_PP_EXPAND(#) endif # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND() +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond @@ -121,7 +121,7 @@ BOOST_PP_EXPAND(#) define BOOST_FT_cond BOOST_FT_cc_cond_v BOOST_PP_EXPAND(#) if BOOST_FT_cond BOOST_PP_EXPAND(#) define BOOST_FT_config_valid 1 #define _() -BOOST_PP_EXPAND(#) include BOOST_PP_EXPAND _()() +BOOST_PP_EXPAND(#) include BOOST_FT_cc_file #undef _ BOOST_PP_EXPAND(#) endif 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 87c6031..da4079c 100644 --- a/include/boost/function_types/detail/pp_cc_loop/preprocessed.hpp +++ b/include/boost/function_types/detail/pp_cc_loop/preprocessed.hpp @@ -15,7 +15,7 @@ # define BOOST_FT_cond BOOST_FT_CC_IMPLICIT # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name @@ -27,7 +27,7 @@ # define BOOST_FT_cond BOOST_FT_CC_CDECL # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name @@ -39,7 +39,7 @@ # define BOOST_FT_cond BOOST_FT_CC_STDCALL # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name @@ -51,7 +51,7 @@ # define BOOST_FT_cond BOOST_FT_CC_PASCAL # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name @@ -63,7 +63,7 @@ # define BOOST_FT_cond BOOST_FT_CC_FASTCALL # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name @@ -75,7 +75,7 @@ # define BOOST_FT_cond BOOST_FT_CC_CLRCALL # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name @@ -87,7 +87,7 @@ # define BOOST_FT_cond BOOST_FT_CC_THISCALL # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name @@ -99,7 +99,7 @@ # define BOOST_FT_cond BOOST_FT_CC_IMPLICIT_THISCALL # if BOOST_FT_cond # define BOOST_FT_config_valid 1 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # endif # undef BOOST_FT_cond # undef BOOST_FT_cc_name @@ -110,7 +110,7 @@ # define BOOST_FT_cc_name implicit_cc # define BOOST_FT_cc BOOST_PP_EMPTY # define BOOST_FT_cond 0x00000001 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_cc_file # undef BOOST_FT_cond # undef BOOST_FT_cc_name # undef BOOST_FT_cc diff --git a/include/boost/function_types/detail/pp_loop.hpp b/include/boost/function_types/detail/pp_loop.hpp index 7521cf2..7d8c347 100644 --- a/include/boost/function_types/detail/pp_loop.hpp +++ b/include/boost/function_types/detail/pp_loop.hpp @@ -28,9 +28,9 @@ #if defined(BOOST_FT_al_path) # define BOOST_FT_cc_file \ - boost/function_types/detail/pp_variate_loop/preprocessed.hpp + # define BOOST_FT_variate_file \ - boost/function_types/detail/pp_arity_loop.hpp + # ifndef BOOST_FT_type_function # define BOOST_FT_type_function(cc,name) BOOST_FT_SYNTAX( \ diff --git a/include/boost/function_types/detail/pp_variate_loop/master.hpp b/include/boost/function_types/detail/pp_variate_loop/master.hpp index cf27477..5026342 100644 --- a/include/boost/function_types/detail/pp_variate_loop/master.hpp +++ b/include/boost/function_types/detail/pp_variate_loop/master.hpp @@ -140,7 +140,7 @@ BOOST_PP_EXPAND(#) define BOOST_FT_cv const volatile # endif # endif BOOST_PP_EXPAND(#) define BOOST_FT_flags BOOST_PP_SLOT(1) -BOOST_PP_EXPAND(#) include BOOST_PP_EXPAND BOOST_PP_EMPTY()() +BOOST_PP_EXPAND(#) include BOOST_FT_variate_file BOOST_PP_EXPAND(#) undef BOOST_FT_cv BOOST_PP_EXPAND(#) undef BOOST_FT_ell diff --git a/include/boost/function_types/detail/pp_variate_loop/preprocessed.hpp b/include/boost/function_types/detail/pp_variate_loop/preprocessed.hpp index d87d519..7e7c4f9 100644 --- a/include/boost/function_types/detail/pp_variate_loop/preprocessed.hpp +++ b/include/boost/function_types/detail/pp_variate_loop/preprocessed.hpp @@ -15,7 +15,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv # define BOOST_FT_flags 519 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -28,7 +28,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv # define BOOST_FT_flags 263 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -42,7 +42,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv const # define BOOST_FT_flags 1543 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -55,7 +55,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv const # define BOOST_FT_flags 1287 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -68,7 +68,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv volatile # define BOOST_FT_flags 2567 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -81,7 +81,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv volatile # define BOOST_FT_flags 2311 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -94,7 +94,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv const volatile # define BOOST_FT_flags 3591 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -107,7 +107,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv const volatile # define BOOST_FT_flags 3335 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -123,7 +123,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv # define BOOST_FT_flags 523 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -136,7 +136,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv # define BOOST_FT_flags 267 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -151,7 +151,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv # define BOOST_FT_flags 531 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -164,7 +164,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv # define BOOST_FT_flags 275 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -181,7 +181,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv # define BOOST_FT_flags 609 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -194,7 +194,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv # define BOOST_FT_flags 353 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -207,7 +207,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv const # define BOOST_FT_flags 1633 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -220,7 +220,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv const # define BOOST_FT_flags 1377 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -233,7 +233,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv volatile # define BOOST_FT_flags 2657 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -246,7 +246,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv volatile # define BOOST_FT_flags 2401 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -259,7 +259,7 @@ # define BOOST_FT_nullary_param BOOST_FT_NULLARY_PARAM # define BOOST_FT_cv const volatile # define BOOST_FT_flags 3681 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param @@ -272,7 +272,7 @@ # define BOOST_FT_nullary_param # define BOOST_FT_cv const volatile # define BOOST_FT_flags 3425 -# include BOOST_PP_EXPAND ( ) +# include BOOST_FT_variate_file # undef BOOST_FT_cv # undef BOOST_FT_ell # undef BOOST_FT_nullary_param diff --git a/include/boost/function_types/is_member_object_pointer.hpp b/include/boost/function_types/is_member_object_pointer.hpp index fbf4850..77527d9 100644 --- a/include/boost/function_types/is_member_object_pointer.hpp +++ b/include/boost/function_types/is_member_object_pointer.hpp @@ -24,10 +24,10 @@ namespace boost < function_types::components , detail::member_object_pointer_tag > { - BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_member_object_pointer,(T,Tag)) + BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_member_object_pointer,(T)) }; } - BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,function_types::is_member_object_pointer) + BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,function_types::is_member_object_pointer) } #endif diff --git a/include/boost/function_types/property_tags.hpp b/include/boost/function_types/property_tags.hpp index b241e1a..bbc64d5 100644 --- a/include/boost/function_types/property_tags.hpp +++ b/include/boost/function_types/property_tags.hpp @@ -141,7 +141,7 @@ template struct extract #include namespace boost { namespace function_types { -#define BOOST_FT_cc_file boost/function_types/detail/pp_tags/cc_tag.hpp +#define BOOST_FT_cc_file #include } } // namespace boost::function_types diff --git a/test/custom_ccs/member_ccs.cpp b/test/custom_ccs/member_ccs.cpp index 727b38b..11f9392 100644 --- a/test/custom_ccs/member_ccs.cpp +++ b/test/custom_ccs/member_ccs.cpp @@ -14,7 +14,7 @@ #include #ifndef BOOST_FT_CC_STDCALL -# error "test not supported with this compiler" +# error "test not supported with this compiler/platform" #endif namespace ft = boost::function_types; diff --git a/test/custom_ccs/member_ccs_exact.cpp b/test/custom_ccs/member_ccs_exact.cpp index 2decf14..413b133 100644 --- a/test/custom_ccs/member_ccs_exact.cpp +++ b/test/custom_ccs/member_ccs_exact.cpp @@ -14,7 +14,7 @@ #include #ifndef BOOST_FT_CC_STDCALL -# error "test not supported with this compiler" +# error "test not supported with this compiler/platform" #endif namespace ft = boost::function_types; diff --git a/test/custom_ccs/nonmember_ccs.cpp b/test/custom_ccs/nonmember_ccs.cpp index 98bf3d5..81681ff 100644 --- a/test/custom_ccs/nonmember_ccs.cpp +++ b/test/custom_ccs/nonmember_ccs.cpp @@ -16,7 +16,7 @@ #include #ifndef BOOST_FT_CC_STDCALL -# error "test not supported with this compiler" +# error "test not supported with this compiler/platform" #endif namespace ft = boost::function_types; diff --git a/test/custom_ccs/nonmember_ccs_exact.cpp b/test/custom_ccs/nonmember_ccs_exact.cpp index 31f73c0..d6db300 100644 --- a/test/custom_ccs/nonmember_ccs_exact.cpp +++ b/test/custom_ccs/nonmember_ccs_exact.cpp @@ -16,7 +16,7 @@ #include #ifndef BOOST_FT_CC_STDCALL -# error "test not supported with this compiler" +# error "test not supported with this compiler/platform" #endif namespace ft = boost::function_types;