|
Boost : |
From: Peder Holt (peder.holt_at_[hidden])
Date: 2005-06-02 10:50:45
On 6/2/05, Chris Uzdavinis <chris_at_[hidden]> wrote:
> "Arkadiy Vertleyb" <vertleyb_at_[hidden]> writes:
>
> > Therefore, if you have an interest in this library, please make sure to take
> > a look at it, and send us your feedback -- it is welcome, and will
> > definitely be considered.
>
> Hi, I have not reviewed the source code, and just downloaded it today
> in fact. However, I do have some questions after reading the
> documentation, and some suggestions for it.
>
> 1) The docs say that the BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
> macro is used in .hpp or .cpp files. I'm curious how it works in a
> .hpp file if that file is included in multiple .cpp files. Does it
> create a new group for the same types in each file?
Yes. That is where the basis for possible ODR violations arises.
We have tried testing if this causes any problems for the compilers we
support, but it seems to work ok.
>
> 2) In the reference section, sample code for BOOST_AUTO and for
> LVALUE_TYPEOF, the code shows a declaration for main with a
> return type of "void", but that is not valid C++. main must be
> declared to return an integer. (Yeah, I'm pedantic.)
Will change this :)
>
> 3) In the reference section, for INTEGRAL, there is a user-defined
> enum named "color", but it is not registered with the typeof
> library. However, in the tutorial section, the text reads,
>
> "If your define your own type, the Typeof Library cannot handle
> it unless you let it know about this type."
>
> So either there are some cases where it's not necessary to
> register, or perhaps the sample code is wrong?
No, the sample is correct. If color is used as a type, it needs to be
registered. If used as an integral constant, it does not need to be
registered.
enum color {red,green,blue};
tempate<typename T>
struct X;
X<color> a;
typedef BOOST_TYPEOF(a) type;
Both X<T> and color needs to be registered.
template<color I>
struct Y;
Y<red> b;
typedef BOOST_TYPEOF(b) type2;
Only Y<color> needs to be registered. red is handled as an integer constant.
>
> NOTE: under the REGISTER_TYPE section, it does show an enum being
> registered. Thus, now I'm confused. :)
>
>
> 4) In the reference section, LIMIT_FUNCTION_ARITY has a typo:
>
> "... are supported for functios,"
>
> "functions" is missing the 'n'.
>
>
> 5) The REGISTER_TEMPLATE sample code does not show how to register a
> template with template-template parameters, but it describes it.
> Later, under the docs for TEMPLATE there is an example. Perhaps
> REGISTER_TEMPLATE should indicate that an example for
> template-template parameter usage appears there, or somehow these
> could be tied together more.
Good idea. Will do.
>
>
> 6) Thats all for now. :) This library looks pretty cool.
Thanks.
>
>
> --
> Chris
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk