[Solved] error: ‘class std::vector’ has no member named ‘sort’


There is no std::vector<...>::sort. Instead, you will need to use std::sort:

std::sort(orderedList.begin(), orderedList.end());

However, this will try to compare the pointers in your std::vector<Shape*> (hint: refactor this if at all possible). Instead, you will need to pass a custom comparator that dereferences the pointers:

std::sort(
    orderedList.begin(),
    orderedList.end(),
    [](Shape *a, Shape *b) { return *a < *b; }
);

1

solved error: ‘class std::vector’ has no member named ‘sort’