
Damien Thivolle <damien@lrde.epita.fr> writes:
Index: ChangeLog from Damien Thivolle <damien@lrde.epita.fr>
* oln/io/utils.hh: Add a traits for g++-3.3.
utils.hh | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
Index: oln/io/utils.hh --- oln/io/utils.hh (revision 72) +++ oln/io/utils.hh (working copy) @@ -150,29 +150,31 @@ }
template <bool b> - struct pnm_io_helper + struct pnm_io_helper_bool { - enum { size = 1}; typedef unsigned char type; };
template <> - struct pnm_io_helper<false> + struct pnm_io_helper_bool<false> { - enum { size = 2}; typedef unsigned short type; };
+ template <unsigned N> + struct pnm_io_helper + { + typedef typename pnm_io_helper_bool<N <= 8>::type type; + };
- } // end of namespace internal
} // end of namespace io
} // end of namespace oln
-# define oln_io_type(N) typename oln::io::internal::pnm_io_helper<N <= 8>::type -# define oln_io_type_(N) oln::io::internal::pnm_io_helper<N <= 8>::type +# define oln_io_type(N) typename oln::io::internal::pnm_io_helper<N>::type +# define oln_io_type_(N) oln::io::internal::pnm_io_helper<N>::type
#endif // ! OLENA_IO_UTILS_HH
Le problème ici est que g++-3.3 appellait l'opérateur <= définit dans intègre. On obtenait une erreur du genre : ../../../olena/oln/io/write_image_2d_pnm.hh:91: error: non-constant ` ntg::internal::operator<= [with T1 = ntg::internal::typetraits<ntg::int_u<8, ntg::strict> >::<anonymous enum>, T2 = int]((&ntg::internal::typetraits<ntg::int_u<8, ntg::strict> >::size), (&8))' cannot be used as template argument -- Damien Thivolle damien@lrde.epita.fr