
astrid <wang_a@epita.fr> writes: Bon, j'ai un bout de code : ------------------------------------------------------- #include <iostream> #include <oln/basics2d.hh> namespace oln { namespace foo { template <class I> struct A { A(const typename I::point_type& p) : p(p) {} typename I::point_type p; }; template <class I> std::ostream& operator<<(std::ostream& os, const A<I>& a) { os << a.p << std::endl; // KO // operator<<(os, a.p) << std::endl; // KO // ::operator<<(os, a.p) << std::endl; // OK return os; } } // foo } // oln using namespace oln; using namespace foo; using namespace ntg; int main() { const A<image2d<int_u8> >& a(point2d(7,13)); std::cout << a << std::endl; } ------------------------------------------------------- Je compile avec g++-3.2 g++-3.2 -I ../olena -I ../integre -I ../metalic pouet.cc -o pouet pouet.cc: In function `std::ostream& oln::foo::operator<<(std::ostream&, const oln::foo::A<I>&) [with I = oln::image2d<ntg::int_u8, mlc::final>]': pouet.cc:42: instantiated from here pouet.cc:23: no match for `std::basic_ostream<char, std::char_traits<char> >& << const oln::point2d&' operator /usr/include/c++/3.2/bits/ostream.tcc:55: candidates are: [... plein de gens qui n'ont rien a voir ...] etc. :( -- astrid