Boost logo

Boost Users :

From: Filip Konvička (filip.konvicka_at_[hidden])
Date: 2007-08-10 04:18:17


Bill Buklis wrote on 10.8.2007 1:19:
>> -----Original Message-----
>> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
>> bounces_at_[hidden]] On Behalf Of Filip Konvicka
>> Sent: Thursday, August 09, 2007 2:34 AM
>> To: boost-users_at_[hidden]
>> Subject: Re: [Boost-users] Visual Studio 2005 ptr_list visualizer?
>>
>> It would work. You always get 3 template arguments, even if you don't
>> supply them. You just get the default allocator. But as I said (now I
>> can point you to the debugger visualizers wiki :-)
>> http://svn.boost.org/trac/boost/wiki/DebuggerVisualizers), in this case
>> the second wildcard will match the 2nd and 3rd template argument
>> ("$T2,$T3" in terms of "<*,*,*>").
>>
>
> That I knew already. I was just wondering out loud that if only two
> arguments <*,*> were specified in the visualizer would it still work for a
> type that included a custom allocator. I looked at how std::vector,
> std::list, etc are specified and none of them include the extra parameter
> for the allocator. So, I'm guessing that it would. Either that or the
> default visualizers are incorrect.
>

Maybe I still don't understand, but I wanted to point out that a pattern
with "<*,*>" still matches a three-argument template, because the
pattern matching is text-based (as I mention in the wiki guide).

Most of the std:: visualizers don't actually use the template argument,
so they're fine with a single * (it suffices that the pattern matches),
and those that do use the asterisks correctly (auto_ptr<*>, deque<*,*>).
> As an aside, I've discovered that the $T1,$T2, etc. seem to go by the
> "asterisks" and not by the template arguments. Given class_name<void**,*>
> for example $T3 represents the second template argument. Go figure. At least
> that was the case when I did the visualizer for
> boost::void_ptr_iterator<void**,*> (used by ptr_array).
>
>
Again, due to the textual processing of the typenames. In the case of
class_name<void**,*> (a pattern, right?), $T1 and $T2 simply match the
empty string ($T1 maybe some pointer "*"s or "const *", depending what
class is being matched against), and $T3 is indeed the second template
parameter. That's what I think is the way it works - no way of telling
that a "*" in a pattern is not a wildcard.
>> BTW, I use multi-template-argument matching in multi_index_container
>> visualizers when I need to pass exactly the same template arguments to
>> another templates, but never when accessing the actual template argument
>> for type casts etc.
>>
>> Now please could you upload the most recent version of your visualizers
>> to the boost vault at
>>
>> http://boost-
>> consulting.com/vault/index.php?directory=Debug/Visualizers_MSVC_8
>>
>
> Now uploaded. The following containers and associated iterators are included
> in this file:
> array
> ptr_array
> ptr_deque
> ptr_list
> ptr_map
> ptr_multimap
> ptr_set
> ptr_multiset
> ptr_vector
>
>
>> ? Please if you do also attach some license info, as I did with
>> boost__multi_index_container.msvc8.vis.txt. If you want, you can add
>> similar comments/headers into your file(s), otherwise I kindly ask you
>> for permission to do this myself. Of course you keep all the credits!
>>
> I followed your example and placed similar information at the top of the
> text file. If it's not right or something's missing, you are free to modify
> the file as necessary. Just let me know, so I can update my local copy to
> match.
>
>

Excellent, thanks! I'll try them out with 1.34 as I promised, and will
mention them in the wiki as well.

Cheers,
Filip


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net