[Interest] How to make QMap work as input to std::ranges::views?

Thiago Macieira thiago.macieira at intel.com
Mon Apr 14 17:19:50 CEST 2025


On Monday, 14 April 2025 07:35:50 Pacific Daylight Time Schimkowitsch Robert 
wrote:
> I have tried and failed, please see https://godbolt.org/z/9zTzP7sYj
> It looks like QMap::asKeyValueRange returns something that is not really
> understood as a range, or not one that views can use.
> 
> How can I use a QMap as input to a std::ranges::views pipeline?

That code doesn't work with std::map either. std::transform is not what you 
want.

You want std::ranges::views::transform. That still doesn't compile and I don't 
understand the error, but I think it's complaining about your lambda now.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Platform & System Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5150 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20250414/492fb338/attachment.bin>


More information about the Interest mailing list