!bjVkyJwFJhjipCRZCH:matrix.org

Programming General

372 Members
For all things programming8 Servers

Load older messages


SenderMessageTime
26 Nov 2022
@_discord_613066600127528969:t2bot.iohash#5127 I meant in general looping rather than "for loop" they can of course they can use iterators. 15:43:37
@_discord_329434866716508161:t2bot.ioShadorain#4182 No iterators in c 15:46:56
@_discord_253577767369703425:t2bot.ioVhyrro#1609 even C++ barely has iterators :p 15:47:18
@_discord_613066600127528969:t2bot.iohash#5127 15:48:53
@_discord_253577767369703425:t2bot.ioVhyrro#1609 you could definitely make really nice iterators in cpp if uh you didn't have to write 200 chars just to get a working lambda 15:48:54
@_discord_613066600127528969:t2bot.iohash#5127 bruh did some one swap shado from different realm 15:48:55
@_discord_253577767369703425:t2bot.ioVhyrro#1609 i think they did yeah 15:48:56
@_discord_253577767369703425:t2bot.ioVhyrro#1609 he's a skinwalker now 15:48:56
@_discord_329434866716508161:t2bot.ioShadorain#4182 Kek 15:48:56
@_discord_329434866716508161:t2bot.ioShadorain#4182 Try in C 15:49:02
@_discord_329434866716508161:t2bot.ioShadorain#4182 Function ptrs are about your only decent abstraction 15:49:23
@_discord_253577767369703425:t2bot.ioVhyrro#1609 for comparison: .map(|x| x + 1) vs .map([&](auto&& x) -> decltype(x) { return x + 1; }) 15:50:07
@_discord_253577767369703425:t2bot.ioVhyrro#1609 hm actually the [&] isn't needed here 15:50:20
@_discord_253577767369703425:t2bot.ioVhyrro#1609 * for comparison: .map(|x| x + 1) vs .map([](auto&& x) -> decltype(x) { return x + 1; }) 15:50:27
@_discord_253577767369703425:t2bot.ioVhyrro#1609 unless cpp requires you to place = or &, you can tell i haven't used the language in a while 15:51:04
@_discord_329434866716508161:t2bot.ioShadorain#4182 I hate cpp 15:51:20
@_discord_329434866716508161:t2bot.ioShadorain#4182 Void pointers work until you want to use a freaking primitive and then your just fked 15:52:38
@_discord_310835408961536000:t2bot.ioKorven@NotGuix could someone explain to me why using iterators is better than using for-loops? (in most situations) 16:40:24
@_discord_253577767369703425:t2bot.ioVhyrro#1609 just more concise syntactically is all 16:41:04
@_discord_253577767369703425:t2bot.ioVhyrro#1609 a for loop can only loop, an iterator can do more advanced things like peek the next element, jump around and allows for some functional paradigm stuff like filter, map, fold etc. 16:41:53
@_discord_310835408961536000:t2bot.ioKorven@NotGuix an iterator can jump around? 16:42:10
@_discord_310835408961536000:t2bot.ioKorven@NotGuix 16:42:12
@_discord_253577767369703425:t2bot.ioVhyrro#1609 the most common ones probably won't 16:42:30
@_discord_253577767369703425:t2bot.ioVhyrro#1609 but yes of course they can 16:42:45
@_discord_253577767369703425:t2bot.ioVhyrro#1609 * the most common ones probably won't for good reason 16:43:38
@_discord_253577767369703425:t2bot.ioVhyrro#1609 you're referring to C here right? 16:44:35
@_discord_253577767369703425:t2bot.ioVhyrro#1609 because you should never ever use void pointers in cpp 16:44:42
@_discord_329434866716508161:t2bot.ioShadorain#4182 yes 17:15:15
@_discord_329434866716508161:t2bot.ioShadorain#4182 fk cpp i dont talk about cpp 😁 17:15:24
@_discord_243787691680858113:t2bot.ioTomás joined the room.18:46:15

There are no newer messages yet.


Back to Room List