mattreecebentley / plf_hive

plf::hive is a fork of plf::colony to match the current C++ standards proposal.
https://plflib.org/colony.htm
zlib License
71 stars 7 forks source link

Return type of const_reverse_iterator::base() should be const_iterator #6

Closed Quuxplusone closed 2 years ago

Quuxplusone commented 2 years ago
#include "plf_hive.h"
#include <type_traits>

int main()
{
    using H = plf::hive<int>;
    H h;
    static_assert(std::is_same_v<decltype(h.rbegin().base()), H::iterator>);  // OK
    static_assert(std::is_same_v<decltype(h.crbegin().base()), H::const_iterator>);  // fails
}
mattreecebentley commented 2 years ago

Fixed in beta

On 23/04/2022 4:21 am, Quuxplusone wrote:

|#include "plf_hive.h" #include int main() { using H = plf::hive; H h; static_assert(std::is_same_v<decltype(h.rbegin().base()), H::iterator>); // OK static_assert(std::is_same_v<decltype(h.crbegin().base()), H::const_iterator>); // fails } |

— Reply to this email directly, view it on GitHub https://github.com/mattreecebentley/plf_hive/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABE4FIT645S5FO7ZMNDTNETVGLGZ7ANCNFSM5UCZCBLA. You are receiving this because you are subscribed to this thread.Message ID: @.***>