Opened 14 years ago

Closed 14 years ago

#2791 closed Bugs (duplicate)

Please remove a warning in tuple_comparison.hpp

Reported by: daigo@… Owned by: Joel de Guzman
Milestone: Boost 1.39.0 Component: tuple
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:

Description

Compiling tuple_comparison.hpp with g++ 4.3.3 causes a warning. You should add parentheses.

/usr/local/src/boost/boost/tuple/tuple_comparison.hpp: In function 'bool boost::tuples::detail::gt(const T1 &, const T2&) [with T1 = boost::tuples::cons<int, boost::tuples::cons<int, boost::tuples::cons<int, boost:: tuples::cons<int, boost::tuples::null_type> > > >, T2 = boost::tuples::cons<int, boost::tuples::cons<int, b oost::tuples::cons<int, boost::tuples::cons<int, boost::tuples::null_type> > > >]': /usr/local/src/boost/boost/tuple/tuple_comparison.hpp:148: instantiated from 'bool boost::tuples::operato r>(const boost::tuples::cons<T1, T2>&, const boost::tuples::cons<S1, S2>&) [with T1 = int, T2 = boost::tupl es::cons<int, boost::tuples::cons<int, boost::tuples::cons<int, boost::tuples::null_type> > >, S1 = int, S2

boost::tuples::cons<int, boost::tuples::cons<int, boost::tuples::cons<int, boost::tuples::null_type> > >

]'

$ g++ -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.3-3' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-cld --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.3.3 (Debian 4.3.3-3)

Index: boost/tuple/tuple_comparison.hpp =================================================================== --- boost/tuple/tuple_comparison.hpp (リビジョン 51377) +++ boost/tuple/tuple_comparison.hpp (作業コピー) @@ -69,8 +69,8 @@

template<class T1, class T2> inline bool lt(const T1& lhs, const T2& rhs) {

return lhs.get_head() < rhs.get_head()
  • !(rhs.get_head() < lhs.get_head()) &&
  • lt(lhs.get_tail(), rhs.get_tail());

+ ( !(rhs.get_head() < lhs.get_head()) && + lt(lhs.get_tail(), rhs.get_tail()));

} template<> inline bool lt<null_type,null_type>(const null_type&, const null_type&) { return false; }

@@ -78,8 +78,8 @@

template<class T1, class T2> inline bool gt(const T1& lhs, const T2& rhs) {

return lhs.get_head() > rhs.get_head()
  • !(rhs.get_head() > lhs.get_head()) &&
  • gt(lhs.get_tail(), rhs.get_tail());

+ ( !(rhs.get_head() > lhs.get_head()) && + gt(lhs.get_tail(), rhs.get_tail()));

} template<> inline bool gt<null_type,null_type>(const null_type&, const null_type&) { return false; }

Attachments (1)

tuple_comparison.hpp.diff (1.1 KB ) - added by daigo@… 14 years ago.
The diff in the body text was not displayed correctly. This is the diff file.

Download all attachments as: .zip

Change History (3)

by daigo@…, 14 years ago

Attachment: tuple_comparison.hpp.diff added

The diff in the body text was not displayed correctly. This is the diff file.

comment:1 by Steven Watanabe, 14 years ago

Component: Nonetuple
Owner: set to Joel de Guzman

comment:2 by Steven Watanabe, 14 years ago

Resolution: duplicate
Status: newclosed

Duplicates #2388.

Note: See TracTickets for help on using tickets.