    #include <vector>
    #include <algorithm>
     
    template <class ED>
    struct EdgeData1 {
        bool operator< (const EdgeData1<ED>& other) const { return indexTo < other.indexTo; } 
        int indexTo;
        ED edgeData;
    };
     
    template <class ED>
    struct EdgeData2 {
        int indexTo;
        ED edgeData;
    };
    template <class ED>
    bool operator<(const EdgeData2<ED>& l, const EdgeData2<ED>& r) { return l.indexTo < r.indexTo; }
     
    std::vector<EdgeData1<int>> v1;
    std::vector<EdgeData2<int>> v2;
     
    int main() {
        std::is_sorted(cbegin(v1), cend(v1));
        std::is_sorted(cbegin(v2), cend(v2));
    }