This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Remove __gnu_pbds::detail::binary_heap::is_heap (PR libstdc++/62045)
- From: Marek Polacek <polacek at redhat dot com>
- To: Xi Ruoyao <ryxi at stu dot xidian dot edu dot cn>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Fri, 10 Mar 2017 12:21:38 +0100
- Subject: Re: [PATCH] Remove __gnu_pbds::detail::binary_heap::is_heap (PR libstdc++/62045)
- Authentication-results: sourceware.org; auth=none
- References: <1489144704.1763.14.camel@stu.xidian.edu.cn>
On Fri, Mar 10, 2017 at 07:18:24PM +0800, Xi Ruoyao wrote:
> Hi,
>
> The ill-formed checking in binary_heap::push_heap has made it
> O(n). Remove this checking.
>
> Since assert_valid also checks if (*this) is a legal heap, we can
> remove is_heap and the assertions using it completely.
I think this patch should also go to libstdc++@gcc.gnu.org.
Marek