Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2005-06-18 20:13:36


David Abrahams wrote:
> [...]
> 1. Proof it

It has been applied to Boost.Lambda and to boost:mem_fn (which is a part of Bind).

I'll attach the results to the end of this post. An archive containing the
results, all refactored code and a diff for Boost.Lambda (to easily spot the
changes) has been uploaded to the vault:

     http://tinyurl.com/c3tpv

> 2. Post updated docs that include the proposed naming changes
> 3. Change the code.
>
> But I'm not too particular about it. I think the proof should come
> first because I'd happily accept assurances in place of steps 2 and 3
> happening before the review period ends.
>

Assurances:

The docs will be revised. This includes clarification of all the spots that have
caused confusion or have been makred as improvable by the reviewers. This also
includes inline examples and adding some kind of (a) simple tutorial(s).

Const/volatile-qualification of member function pointers will be handled through
the class type.

The interface will be put in a sub namespace and the names will be shortened.

Portability and test suite will be extended.

Regards,

Tobias


--- mem_fn

~/boost $ wc -l mem_fn.hpp mem_fn/data_member_adaptor.hpp mem_fn/functor_preprocessed.hpp
     89 mem_fn.hpp
     97 mem_fn/data_member_adaptor.hpp
    466 mem_fn/functor_preprocessed.hpp (#1)
    652 total

The file functor.hpp was not counted because it is only used to generate
functor_preprocessed.hpp with Boost.Preprocessor.

~/boost $ wc -l mem_fn.bak/*
    394 mem_fn.bak/mem_fn.hpp
    103 mem_fn.bak/mem_fn_cc.hpp (#2)
    934 mem_fn.bak/mem_fn_template.hpp (#2) (#1)
    130 mem_fn.bak/mem_fn_vw.hpp (#2)
   1561 total

(#1) times 2 for BOOST_NO_VOID_RETURNS
(#2) times the number of enabled calling conventions

--- lambda

~/boost $ wc -l lambda/* lambda/detail/*
wc: lambda/CVS: Invalid request code
   1377 lambda/algorithm.hpp
     19 lambda/bind.hpp
    219 lambda/casts.hpp
    274 lambda/closures.hpp
    237 lambda/construct.hpp
     22 lambda/control_structures.hpp
     79 lambda/core.hpp
      0 lambda/detail
   1740 lambda/exceptions.hpp
    462 lambda/if.hpp
     34 lambda/lambda.hpp
    505 lambda/loops.hpp
    119 lambda/numeric.hpp
    502 lambda/switch.hpp
    174 lambda/detail/actions.hpp
    110 lambda/detail/arity_code.hpp
   1879 lambda/detail/bind_functions.hpp
     50 lambda/detail/control_constructs_common.hpp
    550 lambda/detail/control_structures_impl.hpp
    519 lambda/detail/function_adaptors.hpp
    104 lambda/detail/is_instance_of.hpp
     48 lambda/detail/lambda_config.hpp
    599 lambda/detail/lambda_functor_base.hpp
    212 lambda/detail/lambda_functors.hpp
     78 lambda/detail/lambda_fwd.hpp
    556 lambda/detail/lambda_traits.hpp
    358 lambda/detail/member_ptr.hpp
    139 lambda/detail/operator_actions.hpp
    271 lambda/detail/operator_lambda_func_base.hpp
    942 lambda/detail/operator_return_type_traits.hpp
    370 lambda/detail/operators.hpp
    325 lambda/detail/ret.hpp
    287 lambda/detail/return_type_traits.hpp
     74 lambda/detail/select_functions.hpp
  13234 total

~/boost $ wc -l lambda.bak/* lambda.bak/detail/*
wc: lambda.bak/CVS: Invalid request code
   1377 lambda.bak/algorithm.hpp
     19 lambda.bak/bind.hpp
    219 lambda.bak/casts.hpp
    274 lambda.bak/closures.hpp
    237 lambda.bak/construct.hpp
     22 lambda.bak/control_structures.hpp
     79 lambda.bak/core.hpp
      0 lambda.bak/detail
   1740 lambda.bak/exceptions.hpp
    462 lambda.bak/if.hpp
     34 lambda.bak/lambda.hpp
    505 lambda.bak/loops.hpp
    119 lambda.bak/numeric.hpp
    502 lambda.bak/switch.hpp
    174 lambda.bak/detail/actions.hpp
    110 lambda.bak/detail/arity_code.hpp
   1879 lambda.bak/detail/bind_functions.hpp
     50 lambda.bak/detail/control_constructs_common.hpp
    550 lambda.bak/detail/control_structures_impl.hpp
    640 lambda.bak/detail/function_adaptors.hpp
    104 lambda.bak/detail/is_instance_of.hpp
     48 lambda.bak/detail/lambda_config.hpp
    599 lambda.bak/detail/lambda_functor_base.hpp
    212 lambda.bak/detail/lambda_functors.hpp
     74 lambda.bak/detail/lambda_fwd.hpp
    527 lambda.bak/detail/lambda_traits.hpp
    737 lambda.bak/detail/member_ptr.hpp
    139 lambda.bak/detail/operator_actions.hpp
    271 lambda.bak/detail/operator_lambda_func_base.hpp
    942 lambda.bak/detail/operator_return_type_traits.hpp
    370 lambda.bak/detail/operators.hpp
    325 lambda.bak/detail/ret.hpp
    284 lambda.bak/detail/return_type_traits.hpp
     74 lambda.bak/detail/select_functions.hpp
  13698 total


Compilers tested with: MSVC 7.1, GCC 3.4

All Lambda tests pass

  (Lambda would probably even work for any calling convention if TypeTraits
   would)

Bind tests for mem_fn pass (*)

  When properly configured all non-standard calling convention tests pass
  (MSVC only, members can not have custom calling conventions with GCC<4
   because of a compiler bug).

  Bind as a whole does not pass because it accesses implementation details of
  the old mem_fn version. It was not changed because of the limitied time.

(*) mem_fn_eq_test does not pass for MSVC - the code involved looks extremely
trivial and compare operators haven't changed - no idea what's up there - not
sure it passed before the changes.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk