
Hi, I have a problem with iterator_facade usage. Error is reported by Comeau and MIPSPro compilers: An error output can be found in regression tables: http://tinyurl.com/37mxz The compiler is reporting, that iterator_core_access cannot access the private equal() function, althought it has been marked as friend. My iterator class is publicaly derived from iterator_facade and privately from another templated class. Is it possible, that multiple inheritance creates the problem? Thanks for any help. Pavol

Pavol Droba wrote:
Hi,
I have a problem with iterator_facade usage. Error is reported by Comeau and MIPSPro compilers:
An error output can be found in regression tables:
The compiler is reporting, that iterator_core_access cannot access the private equal() function, althought it has been marked as friend.
IIUC the compiler is right. The friend declaration in boost::algorithm::find_iterator declares boost::algorithm::iterator_core_access as friend. Not boost::iterator_core_access. IIUC there is no name lookup on unqualified names in friend class declarations. See core issue 138 for further information. Changing the friend declaration to friend class ::boost::iterator_core_access should fix the problem. Thomas -- Thomas Witt witt@acm.org

On Tue, Mar 09, 2004 at 01:40:50PM -0800, Thomas Witt wrote:
Pavol Droba wrote:
Hi,
I have a problem with iterator_facade usage. Error is reported by Comeau and MIPSPro compilers:
An error output can be found in regression tables:
The compiler is reporting, that iterator_core_access cannot access the private equal() function, althought it has been marked as friend.
IIUC the compiler is right. The friend declaration in boost::algorithm::find_iterator declares boost::algorithm::iterator_core_access as friend. Not boost::iterator_core_access. IIUC there is no name lookup on unqualified names in friend class declarations. See core issue 138 for further information.
Changing the friend declaration to friend class ::boost::iterator_core_access should fix the problem.
Thanks for explanation. I didn't know about this issue, although it perfectly makes sense. IMO such an issue should be noted in the iterator_facade docs and examples, because it can be easily overlooked (at least I overlooked it very easily:) ) Regards, Pavol

Pavol Droba <droba@topmail.sk> writes:
On Tue, Mar 09, 2004 at 01:40:50PM -0800, Thomas Witt wrote:
Pavol Droba wrote:
Hi,
I have a problem with iterator_facade usage. Error is reported by Comeau and MIPSPro compilers:
An error output can be found in regression tables:
The compiler is reporting, that iterator_core_access cannot access the private equal() function, althought it has been marked as friend.
IIUC the compiler is right. The friend declaration in boost::algorithm::find_iterator declares boost::algorithm::iterator_core_access as friend. Not boost::iterator_core_access. IIUC there is no name lookup on unqualified names in friend class declarations. See core issue 138 for further information.
Changing the friend declaration to friend class ::boost::iterator_core_access should fix the problem.
Thanks for explanation. I didn't know about this issue, although it perfectly makes sense. IMO such an issue should be noted in the iterator_facade docs and examples, because it can be easily overlooked (at least I overlooked it very easily:) )
Appropriate clarifying patches to the .rst files would be gratefully accepted! You don't need to worry about getting .rst syntax right; we can fix that for you if needed. -- Dave Abrahams Boost Consulting www.boost-consulting.com

On Wed, Mar 10, 2004 at 08:31:29AM -0500, David Abrahams wrote:
Pavol Droba <droba@topmail.sk> writes:
On Tue, Mar 09, 2004 at 01:40:50PM -0800, Thomas Witt wrote:
Pavol Droba wrote:
Hi,
I have a problem with iterator_facade usage. Error is reported by Comeau and MIPSPro compilers:
An error output can be found in regression tables:
The compiler is reporting, that iterator_core_access cannot access the private equal() function, althought it has been marked as friend.
IIUC the compiler is right. The friend declaration in boost::algorithm::find_iterator declares boost::algorithm::iterator_core_access as friend. Not boost::iterator_core_access. IIUC there is no name lookup on unqualified names in friend class declarations. See core issue 138 for further information.
Changing the friend declaration to friend class ::boost::iterator_core_access should fix the problem.
Thanks for explanation. I didn't know about this issue, although it perfectly makes sense. IMO such an issue should be noted in the iterator_facade docs and examples, because it can be easily overlooked (at least I overlooked it very easily:) )
Appropriate clarifying patches to the .rst files would be gratefully accepted! You don't need to worry about getting .rst syntax right; we can fix that for you if needed.
After I finish updating all string_algo docs, I might consider that, however, it is more probable, that somebody else could make it sooner :) Pavol

Pavol Droba <droba@topmail.sk> writes:
Appropriate clarifying patches to the .rst files would be gratefully accepted! You don't need to worry about getting .rst syntax right; we can fix that for you if needed.
After I finish updating all string_algo docs, I might consider that, however, it is more probable, that somebody else could make it sooner :)
On what do you base that assessment? :) -- Dave Abrahams Boost Consulting www.boost-consulting.com

On Wed, Mar 10, 2004 at 02:05:18PM -0500, David Abrahams wrote:
Pavol Droba <droba@topmail.sk> writes:
Appropriate clarifying patches to the .rst files would be gratefully accepted! You don't need to worry about getting .rst syntax right; we can fix that for you if needed.
After I finish updating all string_algo docs, I might consider that, however, it is more probable, that somebody else could make it sooner :)
On what do you base that assessment? :)
Naive believes, probably :) ... Anyway, it somebody (f.e. you) will be updating docs due to any reasons, he might incorporated few words about this issue. Time is a precious resource, therefore I cannot commit to something, that I cannot do in a reasonable time. I understand that asking somebody else to do it is similary hard. So, just take it as a suggestion and maybe put it in your todo list. Regards, Pavol
participants (3)
-
David Abrahams
-
Pavol Droba
-
Thomas Witt