Boost logo

Boost :

From: Vladislav Lazarenko (snail_at_[hidden])
Date: 2006-04-08 11:24:28


Sorry, my fault. Unfortunately I don't have all compilers to test it.
There are some troubles with the code I can just see:

1) No namespace should be used in BOOST_DECLARE_TEMPLATE_FRIEND.
2) friend_maker should be refactored to be unique name for each friend type.

I will fix the code and upload to the Boost Vault, because, looks like, we
started flame. Then people who are interested may pick it up and use.

Thanks you for pointing me to errors.

David Abrahams wrote:
> Vladislav Lazarenko <snail_at_[hidden]> writes:
>
>> # define BOOST_DECLARE_TEMPLATE_FRIEND(T) \
>> namespace boost { namespace template_friend { \
>> struct friend_maker { \
>> typedef T T2; \
>> }; \
>> typedef typename friend_maker::T2 friend_type; \
>> friend friend_type;
>
> <snip>
>
> Okay, this macro opens new namespaces whereever I use it.
>
>
>> namespace boost
>> {
>> // protection from unintended ADL
>> namespace sealed_
>> {
>> template <typename T1, typename T2>
>> class sealed_impl
>> {
>> BOOST_DECLARE_TEMPLATE_FRIEND(T1);
>> BOOST_DECLARE_TEMPLATE_FRIEND(T2);
>
> And here we are opening namespace within a class template body. Last
> time I checked that was illegal.
>
> What am I missing?
>


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