----- Original Message ----- From: "Hartmut Kaiser" <[EMAIL PROTECTED]>
> David B. Held wrote: > > > "Terje Slettebų" <[EMAIL PROTECTED]> wrote in message > > 05ab01c2b695$2f125c70$cb6c6f50@pc">news:05ab01c2b695$2f125c70$cb6c6f50@pc... > > > Sure, that would be fine. I'm not that familiar with > > Boost.PP, though, > > > so I think I leave it to someone else to write that > > version. As quite a > > > bit of code uses yes_type/no_type, now, it may be a good > > idea to keep > > > them, as well, anyway, for backwards compatibility and simplicity. > > > > Using the PP lib seems like overkill to me. > > I think, that using the PP library will give us the possibility to > configure the maximum number of required sizetype typedefs. I've > attached a version of the yes_no_type.hpp, which does so by defining a > constant 'BOOST_MAX_SIZETYPE_COUNT' if this constant isn't already > predefined by the user. > > Regards Hartmut Just a small point, you should include <boost/preprocessor/repetition/repeat.hpp> after your normal include guard. While it won't change the result, it is a waste of time to include it prior to the include guard. One other slight problem is that BOOST_PP_REPEAT goes from 0 to N, which will cause you to get this declaration: typedef char (&size0_t)[0]; ...which is illegal. Separately, I don't particularly think that this is a good use of the pp-lib. You can achieve the effect you want easily: template<int I> struct size_descriptor { typedef char (& type)[I]; }; typedef size_descriptor<1>::type yes_type; typedef size_descriptor<2>::type no_type; ...or something similar, which solves the problem once and for all. Paul Mensonides _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost