Boost logo

Boost :

Subject: Re: [boost] Review Request: impl_ptr (pimpl)
From: Gevorg Voskanyan (gevbsd_at_[hidden])
Date: 2017-08-22 07:50:31


On 21.08.2017 13:48, Vladimir Batov via Boost wrote:
> On 2017-08-21 16:29, Andrzej Krzemienski via Boost wrote:
>> 2017-08-20 0:46 GMT+02:00 Vladimir Batov via Boost
>> <boost_at_[hidden]>:
>>>
>>> 2) As I think I mentioned before impl_ptr is not part of any
>>> namespace by
>>> design... because the way proxy and implementation are connected, the
>>> specialization of impl_ptr<>::implementation. As I also mentioned it
>>> is IMO
>>> only a "problem" for "purists" but not for "practitioners" as from
>>> outside
>>> it is all kosher and accessed via boost::impl_ptr.
>>
>> Could you summarize why using the global namespace is necessary?
>
> template<> struct impl_ptr<Foo>::implementation is a template
> specialization. So, it has to be defined in the original namespace.
> So, if it is
>
> namespace boost
> {
>     template<typename> struct impl_ptr;
> }
>
> then the developer will have to declare his specialization of
> "implementation" inside boost:
>
> namespace boost
> {
>     template<> struct impl_ptr<Foo>::implementation { ... };
> }
>
> That's ugly and wrong. <snip>

FWIW, as a Boost user I don't find that ugly and wrong. Plus we already
do things like

namespace boost {

void assertion_failed(char const * expr, char const * function, char
const * file, long line)
{
 Â Â Â  // ...
}

}

so for a long time now, we have a precedent too.

Regards,
Gevorg


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