Fluorohydride / ygopro-core

ygopro script engine.
MIT License
321 stars 135 forks source link

fix struct card_sort::operator() #593

Closed salix5 closed 3 months ago

salix5 commented 3 months ago

https://en.cppreference.com/w/cpp/container/set

template<
    class Key,
    class Compare = std::less<Key>,
    class Allocator = std::allocator<Key>
> class set;

https://en.cppreference.com/w/cpp/utility/functional/less

constexpr bool operator()( const T& lhs, const T& rhs ) const;

Problem

The signature of card_sort should be:

bool operator()(card* const& c1, card* const& c2) const;

Solution

It is put in a new file sort.h, which contains the declaration of incomplete type card.

@mercury233 @purerosefallen