Opened 4 years ago

Closed 4 years ago

#943 closed defect (fixed)

boost/random/negative_binomial_distribution.hpp in boost 1.69.0 includes deprecated files

Reported by: Peter Owned by: Peter
Priority: trivial Milestone: yat 0.18
Component: random Version: trunk
Keywords: Cc:


I don't see the problem with boost 1.65.1 and according to this thread the issue is fixed in boost 1.70

It results in this rather noisy warning

In file included from /software/boost/boost-1.69.0/include/boost/random/detail/integer_log2.hpp:19:0,
                 from /software/boost/boost-1.69.0/include/boost/random/detail/int_float_pair.hpp:26,
                 from /software/boost/boost-1.69.0/include/boost/random/exponential_distribution.hpp:27,
                 from /software/boost/boost-1.69.0/include/boost/random/gamma_distribution.hpp:25,
                 from /software/boost/boost-1.69.0/include/boost/random/negative_binomial_distribution.hpp:20,
                 from test/
/software/boost/boost-1.69.0/include/boost/pending/integer_log2.hpp:7:59: note: #pragma message: This header is deprecated. Use <boost/integer/integer_log2.hpp> instead.

so would be nice to silence that if possible.

The thread above suggests two solutions 1)

#include <boost/integer/integer_log2.hpp>



The former is probably breaking usage of older boost (whatever older means) whereas the latter seems very promiscuous. One could easily do a configure test checking if needed (we already have those guys for similar warnings) and then #define the macro when needed (only). That solution assumes the same boost bersion is used at yat configure time as when compiling source against yat, i.e., that users don't upgrade boost without re-building yat.

Change History (2)

comment:1 Changed 4 years ago by Peter

Milestone: yat 0.x+yat 0.18
Owner: changed from Jari Häkkinen to Peter
Status: newaccepted

comment:2 Changed 4 years ago by Peter

Resolution: fixed
Status: acceptedclosed

In 3896:

fixes #943, avoid compiler warning about deprecated boost header

Note: See TracTickets for help on using tickets.