id summary reporter owner description type status milestone component version severity resolution keywords cc 7376 join_iterator.hpp compiler warning Leonid Gershanovich Neil Groves "getting compiler warning in boost/range/detail/join_iterator.hpp:74 {{{ 53 template 57 class join_iterator_union 58 { 59 public: 60 typedef Iterator1 iterator1_t; 61 typedef Iterator2 iterator2_t; 62 63 join_iterator_union() {} 64 join_iterator_union(unsigned int /*selected*/, const iterator1_t& it1, const iterator2_t& it2) : m_it1(it1), m_it2(it2) {} 65 66 iterator1_t& it1() { return m_it1; } 67 const iterator1_t& it1() const { return m_it1; } 68 69 iterator2_t& it2() { return m_it2; } 70 const iterator2_t& it2() const { return m_it2; } 71 72 Reference dereference(unsigned int selected) const 73 { 74 return selected ? *m_it2 : *m_it1; 75 } 76 77 bool equal(const join_iterator_union& other, unsigned int selected) const 78 { 79 return selected 80 ? m_it2 == other.m_it2 81 : m_it1 == other.m_it1; 82 } 83 84 private: 85 iterator1_t m_it1; 86 iterator2_t m_it2; 87 }; }}} I am using it in a way when iterator1_t and iterator1_t are different types. Furthermore, underlying types (*m_it1 and *m_it2) are different, but both are convertible to '''Reference''', but not to each other. In other words expression '''*m_it2''' cannot be converted to type iterated by '''iterator1_t''' ( *m_it1 ). But can be safely converted to type '''Reference''' please consider following patch: {{{ @@ -68,7 +68,9 @@ Reference dereference(unsigned int selected) const { - return selected ? *m_it2 : *m_it1; + if (selected) + return *m_it2; + return *m_it1; } bool equal(const join_iterator_union& other, unsigned int selected) const }}} " Bugs closed To Be Determined range Boost 1.51.0 Problem fixed