id summary reporter owner description type status milestone component version severity resolution keywords cc 695 permutation_iterator does not support conversions daniel_kruegler david_abrahams "{{{ The current implementation of boost::permutation_iterator does not support compatible conversions. The below attached example demonstrates the problem. The reason is due to the fact that the converting c'tor template permutation_iterator( permutation_iterator const& r , typename enable_if_convertible::type* = 0 , typename enable_if_convertible::type* = 0 ) : super_t(r.base()), m_elt_iter(r.m_elt_iter) {} is provoked in the example and is generally defective: There exists no public accessor for the private member m_elt_iter and thus it's access is not allowed at the point of its copy construction. There exists two solutions to fix this issue. Since I'm not sure, which is the best one, I propose both: Solution (1): Add template friend class permutation_iterator; inside the permutation_iterator class template. Advantage: Does not change the current interface of permutation_iterator<>, disadvantage: It provides friendship to every template permutation_iterator, which could theoretically be hijacked be programmers, which define their own template specialization of the c'tor (See http://www.gotw.ca/gotw/076.htm ""The Language Lawyer""), although that risk is low. Solution (2): Provide a public accessor for member m_elt_iter, e.g. ElementIterator element_iterator() const { return m_elt_iter; } and call this member function in the conversion c'tor instead of direct member access. The advantage is that no friendship is needed (;-)), the disadvantage is, that it adds a new public member. I actual problem with that accessor for the internal element iterator is: What expect users, which position it corresponds to? Is it its current position or is it its initial position (which is true, of course). The last argument could be weakened by enforcing a more descriptive name, e.g. primary_element_iterator(). I will provide cvs patches in the following minutes }}}" Bugs closed iterator None Fixed