Changeset 62137


Ignore:
Timestamp:
May 22, 2010, 5:35:51 AM (9 years ago)
Author:
Eric Niebler
Message:

Merged revisions 61248 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........

r61248 | eric_niebler | 2010-04-13 08:01:11 -0700 (Tue, 13 Apr 2010) | 1 line


add tr1_result_of that always behaves as TR1 specifies, fix Boost.TR1's result_of to use tr1_result_of

........

Location:
branches/release
Files:
120 edited

Legend:

Unmodified
Added
Removed
  • branches/release

  • branches/release/INSTALL

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/LICENSE_1_0.txt

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost

  • branches/release/boost-build.jam

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost.css

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost.png

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/algorithm/string

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/archive

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/array.hpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/bimap

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/config

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/config/compiler

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/detail

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/filesystem

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/functional/hash

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/fusion

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/gil

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/graph

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/integer

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/interprocess

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/intrusive

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/numeric/ublas

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/program_options

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/property_tree

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/python

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/regex

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/serialization

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/serialization/factory.hpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/signals

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/signals2

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/spirit

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/spirit/home

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/spirit/home/karma

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/spirit/home/support/attributes.hpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/system

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/thread

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/thread.hpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/tr1

  • branches/release/boost/tr1/functional.hpp

    r41369 r62137  
    4949namespace std{ namespace tr1{
    5050
    51    using ::boost::result_of;
     51   template<class F>
     52   struct result_of
     53     : ::boost::tr1_result_of<F>
     54   {};
    5255
    5356} }
  • branches/release/boost/type_traits

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/utility

  • branches/release/boost/utility/detail/result_of_iterate.hpp

    r61149 r62137  
    2121template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
    2222         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
     23struct tr1_result_of<F(BOOST_RESULT_OF_ARGS)>
     24    : mpl::if_<
     25          mpl::or_< is_pointer<F>, is_member_function_pointer<F> >
     26        , boost::detail::tr1_result_of_impl<
     27            typename remove_cv<F>::type,
     28            typename remove_cv<F>::type(BOOST_RESULT_OF_ARGS),
     29            (boost::detail::has_result_type<F>::value)>
     30        , boost::detail::tr1_result_of_impl<
     31            F,
     32            F(BOOST_RESULT_OF_ARGS),
     33            (boost::detail::has_result_type<F>::value)> >::type { };
     34#endif
     35
     36#if !defined(BOOST_NO_DECLTYPE) && defined(BOOST_RESULT_OF_USE_DECLTYPE)
     37
     38// As of N2588, C++0x result_of only supports function call
     39// expressions of the form f(x). This precludes support for member
     40// function pointers, which are invoked with expressions of the form
     41// o->*f(x). This implementation supports both.
     42template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
     43         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
     44struct result_of<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))>
     45    : mpl::if_<
     46          mpl::or_< is_pointer<F>, is_member_function_pointer<F> >
     47        , detail::tr1_result_of_impl<
     48            typename remove_cv<F>::type,
     49            typename remove_cv<F>::type(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), false
     50          >
     51        , detail::cpp0x_result_of_impl<
     52              F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))
     53          >
     54      >::type
     55{};
     56
     57namespace detail {
     58
     59# define BOOST_RESULT_OF_STATIC_MEMBERS(z, n, _) \
     60     static T ## n t ## n; \
     61  /**/
     62
     63template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
     64         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
     65class cpp0x_result_of_impl<F(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T))>
     66{
     67  static F f;
     68  BOOST_PP_REPEAT(BOOST_PP_ITERATION(), BOOST_RESULT_OF_STATIC_MEMBERS, _)
     69public:
     70  typedef decltype(f(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),t))) type;
     71};
     72
     73} // namespace detail
     74
     75#else // defined(BOOST_NO_DECLTYPE)
     76
     77#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
     78template<typename F BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
     79         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
    2380struct result_of<F(BOOST_RESULT_OF_ARGS)>
    24     : boost::detail::result_of_impl<F, F(BOOST_RESULT_OF_ARGS), (boost::detail::has_result_type<F>::value)> {};
     81    : tr1_result_of<F(BOOST_RESULT_OF_ARGS)> { };
    2582#endif
     83
     84#endif // defined(BOOST_NO_DECLTYPE)
    2685
    2786#undef BOOST_RESULT_OF_ARGS
     
    3392template<typename R,  typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
    3493         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
    35 struct result_of_impl<R (*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
     94struct tr1_result_of_impl<R (*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
    3695{
    3796  typedef R type;
     
    4099template<typename R,  typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
    41100         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
    42 struct result_of_impl<R (&)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
     101struct tr1_result_of_impl<R (&)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),T)), FArgs, false>
    43102{
    44103  typedef R type;
     
    48107template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
    49108         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
    50 struct result_of_impl<R (T0::*)
     109struct tr1_result_of_impl<R (T0::*)
    51110                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T)),
    52111                 FArgs, false>
     
    57116template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
    58117         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
    59 struct result_of_impl<R (T0::*)
     118struct tr1_result_of_impl<R (T0::*)
    60119                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
    61120                     const,
     
    67126template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
    68127         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
    69 struct result_of_impl<R (T0::*)
     128struct tr1_result_of_impl<R (T0::*)
    70129                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
    71130                     volatile,
     
    77136template<typename R, typename FArgs BOOST_PP_COMMA_IF(BOOST_PP_ITERATION())
    78137         BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(),typename T)>
    79 struct result_of_impl<R (T0::*)
     138struct tr1_result_of_impl<R (T0::*)
    80139                     (BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ITERATION(),T))
    81140                     const volatile,
  • branches/release/boost/utility/result_of.hpp

    r61149 r62137  
    1111
    1212#include <boost/config.hpp>
    13 #include <boost/type_traits/ice.hpp>
    14 #include <boost/type.hpp>
    15 #include <boost/preprocessor.hpp>
     13#include <boost/preprocessor/iteration/iterate.hpp>
     14#include <boost/preprocessor/punctuation/comma_if.hpp>
     15#include <boost/preprocessor/repetition/enum_params.hpp>
     16#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
    1617#include <boost/detail/workaround.hpp>
    1718#include <boost/mpl/has_xxx.hpp>
    1819#include <boost/mpl/if.hpp>
    1920#include <boost/mpl/bool.hpp>
     21#include <boost/mpl/or.hpp>
     22#include <boost/type_traits/is_pointer.hpp>
     23#include <boost/type_traits/is_member_function_pointer.hpp>
     24#include <boost/type_traits/remove_cv.hpp>
    2025
    2126#ifndef BOOST_RESULT_OF_NUM_ARGS
     
    2631
    2732template<typename F> struct result_of;
     33template<typename F> struct tr1_result_of; // a TR1-style implementation of result_of
    2834
    2935#if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
     
    3238BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
    3339
    34 template<typename F, typename FArgs, bool HasResultType> struct result_of_impl;
     40template<typename F, typename FArgs, bool HasResultType> struct tr1_result_of_impl;
     41template<typename F> struct cpp0x_result_of_impl;
    3542
    3643template<typename F>
     
    5259};
    5360
     61// Determine the return type of a function pointer or pointer to member.
    5462template<typename F, typename FArgs>
    55 struct result_of_impl<F, FArgs, true>
     63struct result_of_pointer
     64  : tr1_result_of_impl<typename remove_cv<F>::type, FArgs, false> { };
     65
     66template<typename F, typename FArgs>
     67struct tr1_result_of_impl<F, FArgs, true>
    5668{
    5769  typedef typename F::result_type type;
     
    6981
    7082template<typename F, typename FArgs>
    71 struct result_of_impl<F, FArgs, false>
     83struct tr1_result_of_impl<F, FArgs, false>
    7284  : mpl::if_<is_function_with_no_args<FArgs>,
    7385             result_of_void_impl<F>,
  • branches/release/boost/utility/value_init.hpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/uuid

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/variant

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/boost/wave

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/bootstrap.bat

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/bootstrap.sh

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/doc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/index.htm

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs

  • branches/release/libs/array/doc/array.xml

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/array/test/array0.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/bimap

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/config

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/config/doc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/filesystem

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/functional/hash

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/fusion

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/graph_parallel

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/integer

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/interprocess

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/intrusive

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/data-types-concepts.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/inserter-class.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/numeric/ublas

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/numeric/ublas/doc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/property_tree

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/python

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/regex

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/regex/doc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/serialization

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/signals

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/signals2

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/spirit

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/spirit/classic/example

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/spirit/doc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/spirit/example

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/spirit/phoenix

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/spirit/test

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/spirit/test/qi/optional.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/static_assert

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/system

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/thread

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/timer

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/tr1

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/type_traits

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/utility

  • branches/release/libs/utility/swap.html

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/utility/swap/test/std_bitset.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/utility/test/result_of_test.cpp

    r61149 r62137  
    55//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
    66//  http://www.boost.org/LICENSE_1_0.txt)
     7
     8#define BOOST_RESULT_OF_USE_DECLTYPE
    79
    810// For more information, see http://www.boost.org/libs/utility
     
    1214#include <boost/type_traits/is_same.hpp>
    1315
    14 struct int_result_type { typedef int result_type; };
     16struct int_result_type
     17{
     18  typedef int result_type;
     19  result_type operator()(float);
     20};
    1521
    1622struct int_result_of
    1723{
    1824  template<typename F> struct result { typedef int type; };
    19 };
    20 
    21 struct int_result_type_and_float_result_of
     25  result<int_result_of(double)>::type operator()(double);
     26  result<const int_result_of(double)>::type operator()(double) const;
     27  result<int_result_of()>::type operator()();
     28  result<volatile int_result_of()>::type operator()() volatile;
     29};
     30
     31struct int_result_type_and_float_result_of_and_char_return
    2232{
    2333  typedef int result_type;
    2434  template<typename F> struct result { typedef float type; };
    25 };
    26 
    27 template<typename T>
    28 struct int_result_type_template { typedef int result_type; };
     35  char operator()(char);
     36};
     37
     38template<typename T>
     39struct int_result_type_template
     40{
     41  typedef int result_type;
     42  result_type operator()(float);
     43};
    2944
    3045template<typename T>
     
    3348  template<typename F> struct result;
    3449  template<typename This, typename That> struct result<This(That)> { typedef int type; };
    35 };
    36 
    37 template<typename T>
    38 struct int_result_type_and_float_result_of_template
     50  typename result<int_result_of_template<T>(double)>::type operator()(double);
     51  typename result<const int_result_of_template<T>(double)>::type operator()(double) const;
     52  typename result<int_result_of_template<T>(double)>::type operator()();
     53  typename result<volatile int_result_of_template<T>(double)>::type operator()() volatile;
     54};
     55
     56template<typename T>
     57struct int_result_type_and_float_result_of_and_char_return_template
    3958{
    4059  typedef int result_type;
    4160  template<typename F> struct result;
    4261  template<typename This, typename That> struct result<This(That)> { typedef float type; };
     62  char operator()(char);
     63};
     64
     65struct result_of_member_function_template
     66{
     67  template<typename F> struct result;
     68
     69  template<typename This, typename That> struct result<This(That)> { typedef That type; };
     70  template<class T> typename result<result_of_member_function_template(T)>::type operator()(T);
     71
     72  template<typename This, typename That> struct result<const This(That)> { typedef const That type; };
     73  template<class T> typename result<const result_of_member_function_template(T)>::type operator()(T) const;
     74
     75  template<typename This, typename That> struct result<volatile This(That)> { typedef volatile That type; };
     76  template<class T> typename result<volatile result_of_member_function_template(T)>::type operator()(T) volatile;
     77
     78  template<typename This, typename That> struct result<const volatile This(That)> { typedef const volatile That type; };
     79  template<class T> typename result<const volatile result_of_member_function_template(T)>::type operator()(T) const volatile;
     80
     81  template<typename This, typename That> struct result<This(That &, That)> { typedef That & type; };
     82  template<class T> typename result<result_of_member_function_template(T &, T)>::type operator()(T &, T);
     83
     84  template<typename This, typename That> struct result<This(That const &, That)> { typedef That const & type; };
     85  template<class T> typename result<result_of_member_function_template(T const &, T)>::type operator()(T const &, T);
     86
     87  template<typename This, typename That> struct result<This(That volatile &, That)> { typedef That volatile & type; };
     88  template<class T> typename result<result_of_member_function_template(T volatile &, T)>::type operator()(T volatile &, T);
     89
     90  template<typename This, typename That> struct result<This(That const volatile &, That)> { typedef That const volatile & type; };
     91  template<class T> typename result<result_of_member_function_template(T const volatile &, T)>::type operator()(T const volatile &, T);
     92};
     93
     94struct no_result_type_or_result_of
     95{
     96  int operator()(double);
     97  short operator()(double) const;
     98  unsigned int operator()();
     99  unsigned short operator()() volatile;
     100  const unsigned short operator()() const volatile;
     101};
     102
     103template<typename T>
     104struct no_result_type_or_result_of_template
     105{
     106  int operator()(double);
     107  short operator()(double) const;
     108  unsigned int operator()();
     109  unsigned short operator()() volatile;
     110  const unsigned short operator()() const volatile;
    43111};
    44112
     
    61129  BOOST_STATIC_ASSERT((is_same<result_of<int_result_type(float)>::type, int>::value));
    62130  BOOST_STATIC_ASSERT((is_same<result_of<int_result_of(double)>::type, int>::value));
    63   BOOST_STATIC_ASSERT((is_same<result_of<int_result_of(void)>::type, void>::value));
    64131  BOOST_STATIC_ASSERT((is_same<result_of<const int_result_of(double)>::type, int>::value));
    65   BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of(void)>::type, void>::value));
    66   BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of(char)>::type, int>::value));
    67132  BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_template<void>(float)>::type, int>::value));
    68133  BOOST_STATIC_ASSERT((is_same<result_of<int_result_of_template<void>(double)>::type, int>::value));
     134  BOOST_STATIC_ASSERT((is_same<result_of<const int_result_of_template<void>(double)>::type, int>::value));
     135
     136  BOOST_STATIC_ASSERT((is_same<tr1_result_of<int_result_type(float)>::type, int>::value));
     137  BOOST_STATIC_ASSERT((is_same<tr1_result_of<int_result_of(double)>::type, int>::value));
     138  BOOST_STATIC_ASSERT((is_same<tr1_result_of<const int_result_of(double)>::type, int>::value));
     139  BOOST_STATIC_ASSERT((is_same<tr1_result_of<int_result_type_template<void>(float)>::type, int>::value));
     140  BOOST_STATIC_ASSERT((is_same<tr1_result_of<int_result_of_template<void>(double)>::type, int>::value));
     141  BOOST_STATIC_ASSERT((is_same<tr1_result_of<const int_result_of_template<void>(double)>::type, int>::value));
     142
     143  BOOST_STATIC_ASSERT((is_same<tr1_result_of<int_result_of(void)>::type, void>::value));
     144  BOOST_STATIC_ASSERT((is_same<tr1_result_of<volatile int_result_of(void)>::type, void>::value));
     145  BOOST_STATIC_ASSERT((is_same<tr1_result_of<int_result_of_template<void>(void)>::type, void>::value));
     146  BOOST_STATIC_ASSERT((is_same<tr1_result_of<volatile int_result_of_template<void>(void)>::type, void>::value));
     147
     148  // Prior to decltype, result_of could not deduce the return type
     149  // nullary function objects unless they exposed a result_type.
     150#if !defined(BOOST_NO_DECLTYPE)
     151  BOOST_STATIC_ASSERT((is_same<result_of<int_result_of(void)>::type, int>::value));
     152  BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of(void)>::type, int>::value));
     153  BOOST_STATIC_ASSERT((is_same<result_of<int_result_of_template<void>(void)>::type, int>::value));
     154  BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of_template<void>(void)>::type, int>::value));
     155#else
     156  BOOST_STATIC_ASSERT((is_same<result_of<int_result_of(void)>::type, void>::value));
     157  BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of(void)>::type, void>::value));
    69158  BOOST_STATIC_ASSERT((is_same<result_of<int_result_of_template<void>(void)>::type, void>::value));
    70   BOOST_STATIC_ASSERT((is_same<result_of<const int_result_of_template<void>(double)>::type, int>::value));
    71159  BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of_template<void>(void)>::type, void>::value));
    72   BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_template<void>(char)>::type, int>::value));
     160#endif
     161
     162  BOOST_STATIC_ASSERT((is_same<tr1_result_of<int_result_type_and_float_result_of_and_char_return(char)>::type, int>::value));
     163  BOOST_STATIC_ASSERT((is_same<tr1_result_of<int_result_type_and_float_result_of_and_char_return_template<void>(char)>::type, int>::value));
     164
     165  // Prior to decltype, result_of ignored a nested result<> if
     166  // result_type was defined. After decltype, result_of deduces the
     167  // actual return type of the function object, ignoring both
     168  // result<> and result_type.
     169#if !defined(BOOST_NO_DECLTYPE)
     170  BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return(char)>::type, char>::value));
     171  BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return_template<void>(char)>::type, char>::value));
     172#else
     173  BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return(char)>::type, int>::value));
     174  BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return_template<void>(char)>::type, int>::value));
     175#endif
     176
    73177  BOOST_STATIC_ASSERT((is_same<result_of<func_ptr(char, float)>::type, int>::value));
    74178  BOOST_STATIC_ASSERT((is_same<result_of<func_ref(char, float)>::type, int>::value));
     
    82186  BOOST_STATIC_ASSERT((is_same<result_of<func_ptr(void)>::type, int>::value));
    83187
     188  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ptr(char, float)>::type, int>::value));
     189  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ref(char, float)>::type, int>::value));
     190  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ptr_0()>::type, int>::value));
     191  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ref_0()>::type, int>::value));
     192  BOOST_STATIC_ASSERT((is_same<tr1_result_of<mem_func_ptr(X,char)>::type, int>::value));
     193  BOOST_STATIC_ASSERT((is_same<tr1_result_of<mem_func_ptr_c(X,char)>::type, int>::value));
     194  BOOST_STATIC_ASSERT((is_same<tr1_result_of<mem_func_ptr_v(X,char)>::type, int>::value));
     195  BOOST_STATIC_ASSERT((is_same<tr1_result_of<mem_func_ptr_cv(X,char)>::type, int>::value));
     196  BOOST_STATIC_ASSERT((is_same<tr1_result_of<mem_func_ptr_0(X)>::type, int>::value));
     197  BOOST_STATIC_ASSERT((is_same<tr1_result_of<func_ptr(void)>::type, int>::value));
     198
     199  BOOST_STATIC_ASSERT((is_same<result_of<result_of_member_function_template(double)>::type, double>::value));
     200  BOOST_STATIC_ASSERT((is_same<result_of<const result_of_member_function_template(double)>::type, const double>::value));
     201  BOOST_STATIC_ASSERT((is_same<result_of<volatile result_of_member_function_template(double)>::type, volatile double>::value));
     202  BOOST_STATIC_ASSERT((is_same<result_of<const volatile result_of_member_function_template(double)>::type, const volatile double>::value));
     203  BOOST_STATIC_ASSERT((is_same<result_of<result_of_member_function_template(int &, int)>::type, int &>::value));
     204  BOOST_STATIC_ASSERT((is_same<result_of<result_of_member_function_template(int const &, int)>::type, int const &>::value));
     205  BOOST_STATIC_ASSERT((is_same<result_of<result_of_member_function_template(int volatile &, int)>::type, int volatile &>::value));
     206  BOOST_STATIC_ASSERT((is_same<result_of<result_of_member_function_template(int const volatile &, int)>::type, int const volatile &>::value));
     207
     208  BOOST_STATIC_ASSERT((is_same<tr1_result_of<result_of_member_function_template(double)>::type, double>::value));
     209  BOOST_STATIC_ASSERT((is_same<tr1_result_of<const result_of_member_function_template(double)>::type, const double>::value));
     210  BOOST_STATIC_ASSERT((is_same<tr1_result_of<volatile result_of_member_function_template(double)>::type, volatile double>::value));
     211  BOOST_STATIC_ASSERT((is_same<tr1_result_of<const volatile result_of_member_function_template(double)>::type, const volatile double>::value));
     212  BOOST_STATIC_ASSERT((is_same<tr1_result_of<result_of_member_function_template(int &, int)>::type, int &>::value));
     213  BOOST_STATIC_ASSERT((is_same<tr1_result_of<result_of_member_function_template(int const &, int)>::type, int const &>::value));
     214  BOOST_STATIC_ASSERT((is_same<tr1_result_of<result_of_member_function_template(int volatile &, int)>::type, int volatile &>::value));
     215  BOOST_STATIC_ASSERT((is_same<tr1_result_of<result_of_member_function_template(int const volatile &, int)>::type, int const volatile &>::value));
     216
     217  typedef int (*pf_t)(int);
     218  BOOST_STATIC_ASSERT((is_same<result_of<pf_t(int)>::type, int>::value));
     219  BOOST_STATIC_ASSERT((is_same<result_of<pf_t const(int)>::type,int>::value));
     220
     221  BOOST_STATIC_ASSERT((is_same<tr1_result_of<pf_t(int)>::type, int>::value));
     222  BOOST_STATIC_ASSERT((is_same<tr1_result_of<pf_t const(int)>::type,int>::value));
     223
     224#if !defined(BOOST_NO_DECLTYPE)
     225  BOOST_STATIC_ASSERT((is_same<result_of<no_result_type_or_result_of(double)>::type, int>::value));
     226  BOOST_STATIC_ASSERT((is_same<result_of<no_result_type_or_result_of(void)>::type, unsigned int>::value));
     227  BOOST_STATIC_ASSERT((is_same<result_of<const no_result_type_or_result_of(double)>::type, short>::value));
     228  BOOST_STATIC_ASSERT((is_same<result_of<volatile no_result_type_or_result_of(void)>::type, unsigned short>::value));
     229  BOOST_STATIC_ASSERT((is_same<result_of<const volatile no_result_type_or_result_of(void)>::type, const unsigned short>::value));
     230  BOOST_STATIC_ASSERT((is_same<result_of<no_result_type_or_result_of_template<void>(double)>::type, int>::value));
     231  BOOST_STATIC_ASSERT((is_same<result_of<no_result_type_or_result_of_template<void>(void)>::type, unsigned int>::value));
     232  BOOST_STATIC_ASSERT((is_same<result_of<const no_result_type_or_result_of_template<void>(double)>::type, short>::value));
     233  BOOST_STATIC_ASSERT((is_same<result_of<volatile no_result_type_or_result_of_template<void>(void)>::type, unsigned short>::value));
     234  BOOST_STATIC_ASSERT((is_same<result_of<const volatile no_result_type_or_result_of_template<void>(void)>::type, const unsigned short>::value));
     235#endif
     236
    84237  return 0;
    85238}
  • branches/release/libs/utility/value_init.htm

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/utility/value_init_test.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/uuid

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/libs/wave

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/people

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/rst.css

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/status

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/status/Jamfile.v2

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools/bcp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools/boostbook

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools/inspect

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools/jam

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools/quickbook

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools/regression

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools/release

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/tools/wave

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release/wiki

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.