Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: TypeErasure
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-05-23 10:31:38


On 05/22/12 15:34, Steven Watanabe wrote:
[snip]
> Online documentation can be found here:
> http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/
[snip]
Looks very interesting.

I've done a somewhat brief review of just the online documentation.
I'll try to do a more complete review later.

Here's my current comments:

* Virtual functions do not *require* dynamic memory:

   The page:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/index.html

   says:

     C++ provides runtime polymorphism through virtual functions. ...
     They require dynamic memory management.

   However, I don't think dynamic memory is required because just
   references to stack locations or pointers pointing to stack
   locations could be used to take advantage of virtual functions.

* 'Operation' term used before defined:

   The page:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost_typeerasure/multi.html

   says:

     Operations can have more than one any argument.

   before any definition of 'Operation' occurs. Only by seeing the:

     addable<>

   argument to the mpl::vector does the term 'Operation' begin to make
   sense, and then the reader has to guess that all the mpl::vector
   arguments are operations, and that all the previous 'operations'
   were unary.

   However, I'm still not sure that's correct. It would help if some
   link to 'Operation' defintion were provided everywhere that the
   term, 'Operation', occurs.

   Maybe, where the term, 'opeation" occurs, there should be a link to:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost_typeerasure/predef.html

* 'match' term used before defined:

   The page:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost_typeerasure/multi.html

   says:

     The types of the arguments must match or the behavior is
     undefined.

   before any definition of 'match' or 'arguments' occurs. I'm just
   guessing from the arguments to x and y, that 'arguments' means
   arguments to the any CTOR, but then the CTOR argument to z is an
   expression; hence, I'm guessing that that expression is allowed by
   the addable<> template argument to the mpl::vector arg to the
   any_type.

* public construct/copy/destruct item 1 undefined T:

   The page:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost/type_erasure/any.html

   under:

     1. template<typename U> explicit any(const U & data);

   says:

     oncept must not refer to any placeholder besides T.

   However, T is not defined (or the definition is not obvious).

* Mistitled Assign operator description:

   The page:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost/type_erasure/any_Concept__T___id2513644.html

   says:

     any public construct/copy/destruct

     1. any& operator=(const any & other);

        Assigns to an any.

   Shouldn't this be retitled something like:

     any public assign operator

     1. any& operator=(const any & other);

        Assigns to an any.

* Misplaced copy CTOR description:

   The page:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost/type_erasure/any_Concept__T___id2513644.html

   says:

     any public member functions

       1. template<typename U> any(U & arg);

   This this is a constructor, not a member function, shouldn't this be
   moved to:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost/type_erasure/any.html

   and placed under:

     any public construct/copy/destruct

   Also, all of the other items seem to be CTOR descriptions also;
   hence, shouldn't they be similarly moved?

* Typo "more general" in 'Design Notes.Constructors':

   The page:

 
http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost_typeerasure/design.html

   says:

     The last kind of constructor "upcasts" from one concept to another
     more general more general concept.

   with the typo of duplicated "more general".

-regards,
Larry


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