Elektrine lite

← Feed

@taschenorakel@mastodon.green

2026-01-21 10:46 UTC

@tagir_valeev C++? Why no structured bindings for `it.second` and `it.first`? Why actually std::pair<> instead of a dedicated POD? Modern C++ makes it so trivial to use them, even as return value.

Replies (1)

  • @taschenorakel it's Kotlin, but your question is very valid. Declaring a custom data class is a one-liner, but people still use the Pair class from the standard library, because it's already there. Generic Pair class is a mistake. It promotes lazy programming. Luckily Java doesn't have it.

    Open ##1205403