C++ Logo

std-proposals

Advanced search

Enabling list-initialization for algorithms

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Tue, 27 Oct 2020 19:58:17 +0100
Hi,

I'm now able to post a draft for my proposal to default some algorithms'
template type parameters, so that they become usable with
list-initialization. It's currently sitting here (waiting for a number):

> https://www.kdab.com/~peppe/cpp_proposals/algorithm_list_init/


TL;DR: I want to make this work:

> struct point { int x; int y; };
>
> std::vector<point> v;
>
> v.push_back({3, 4});
>
> std::find(v.begin(), v.end(), {3, 4}); // OK
> std::lower_bound(v.begin(), v.end(), {3, 4}); // OK
> std::search_n(v.begin(), v.end(), 10, {3, 4}); // OK
> erase(v, {3, 4}); // OK


Any feedback is, as usual, much appreciated.


Thank you and stay safe,
-- 
Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Received on 2020-10-27 13:58:23