luntergroup / octopus

Bayesian haplotype-based mutation calling
MIT License
299 stars 37 forks source link

Remove depreciated inheritance of std::unary_function #264

Open GWW opened 10 months ago

GWW commented 10 months ago

Hi,

I have been trying to compile octopus with g++ v12.2.0 and I get errors related to std::unary_function being depreciated. I am not sure if removing these would cause problems with earlier versions of gcc. It seems like base class inheritance is being slowly being depreciated.

For example:

src/core/types/shared_haplotype.hpp:105:46: error: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Werror=deprecated-declarations]
  105 | struct hash<octopus::SharedHaplotype> : std::unary_function<octopus::SharedHaplotype, std::size_t>

I went through the files and removed the inheritance from the following files and it compiles succesfully:

core/types/shared_haplotype.hpp:struct hash<octopus::SharedHaplotype> : std::unary_function<octopus::SharedHaplotype, std::size_t>
core/types/indexed_haplotype.hpp:        : std::unary_function<octopus::IndexedHaplotype<IndexType, EqualityPolicy, IsSortedIndex>, std::size_t>
core/types/haplotype.hpp:template <> struct hash<octopus::Haplotype> : std::unary_function<octopus::Haplotype, std::size_t>
core/types/allele.hpp:: std::unary_function<octopus::BasicAllele<RegionTp>, std::size_t>
basics/cigar_string.hpp:struct hash<octopus::CigarOperation> : std::unary_function<octopus::CigarOperation, std::size_t>
basics/cigar_string.hpp:struct hash<octopus::CigarString> : std::unary_function<octopus::CigarString, std::size_t>
basics/aligned_read.hpp:template <> struct hash<octopus::AlignedRead> : std::unary_function<octopus::AlignedRead, std::size_t>