COIN-OR::LEMON - Graph Library

Ticket #680: fix_cpp_17_compilation_warnings.patch

File fix_cpp_17_compilation_warnings.patch, 1.8 KB (added by Roberto Turrado Camblor, 15 months ago)

Patch with fix.

  • lemon/maps.h

    Subject: [PATCH] Fix C++17 compilation warnings regarding the use of the deprecated std::iterator.
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/lemon/maps.h b/lemon/maps.h
    a b  
    19691969    /// be accessed in the <tt>[beginValue, endValue)</tt> range.
    19701970    /// They are considered with multiplicity, so each value is
    19711971    /// traversed for each item it is assigned to.
    1972     class ValueIt
    1973       : public std::iterator<std::forward_iterator_tag, Value> {
     1972    class ValueIt {
    19741973      friend class CrossRefMap;
    19751974    private:
    19761975      ValueIt(typename Container::const_iterator _it)
    19771976        : it(_it) {}
    19781977    public:
     1978      using iterator_category = std::forward_iterator_tag;
     1979      using value_type = Value;
     1980      using difference_type = void;
     1981      using pointer = void;
     1982      using reference = void;
    19791983
    19801984      /// Constructor
    19811985      ValueIt() {}
     
    31313135    /// This iterator is an STL compatible forward
    31323136    /// iterator on the values of the map. The values can
    31333137    /// be accessed in the <tt>[beginValue, endValue)</tt> range.
    3134     class ValueIt
    3135       : public std::iterator<std::forward_iterator_tag, Value> {
     3138    class ValueIt {
    31363139      friend class IterableValueMap;
    31373140    private:
    31383141      ValueIt(typename std::map<Value, Key>::const_iterator _it)
    31393142        : it(_it) {}
    31403143    public:
     3144      using iterator_category = std::forward_iterator_tag;
     3145      using value_type = Value;
     3146      using difference_type = void;
     3147      using pointer = void;
     3148      using reference = void;
    31413149
    31423150      /// Constructor
    31433151      ValueIt() {}