Boost logo

Boost :

Subject: Re: [boost] Friend class with namespace gives compiler error for C6000 TI
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2015-02-25 08:18:52


On Wed, Feb 25, 2015 at 2:15 PM, Alin Popa <alin.popa_at_[hidden]> wrote:
> Hi,
>
> I compile my project with boost header only files, the compiler is C6000
> Texas Instruments.
>
> The compile errors occurs for example in
> "boost/algorithm/string/find_iterator.hpp"
>
> I have extracted the cause of the problem in the next example code:
>
> namespace boost {
> namespace iterators {
> class iterator_core_access {
> public:
> iterator_core_access(){}
> ~iterator_core_access(){}
> };
> }
> using iterators::iterator_core_access;
> }
> class testFriend {
> private:
> // don't work, compiler error: error: namespace "boost" has no actual
> member "iterator_core_access"
> friend class ::boost::iterator_core_access; // here is the problem
> // it works, compiles ok, this was my cure
> //friend class ::boost::iterators::iterator_core_access;
> };
>
> int main ()
> {
> // it works
> ::boost::iterator_core_access a;
> return 0;
> }
>
> Do you guys know what is the reason of this ?
> With msvc and g++ works fine.

Most of Boost.Iterator components, including iterator_core_access,
were moved to the boost::iterators namespace in recent releases. The
names are imported into boost namespace for backward compatibility. As
far as I can tell, this should be enough and the friend declaration
should still be valid. If I'm not missing anything, this is a compiler
issue.


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