← Home ← Back to /g/

Thread 106956287

212 posts 50 images /g/
Anonymous No.106956287 [Report] >>106956407 >>106956413 >>106956424 >>106956491 >>106956535 >>106956545 >>106956750 >>106956999 >>106957008 >>106957128 >>106957204 >>106957228 >>106957952 >>106958361 >>106958374 >>106958635 >>106958908 >>106959047 >>106959134 >>106959148 >>106959178 >>106959365 >>106959443 >>106960027 >>106960118 >>106960555 >>106960788 >>106961032 >>106962637 >>106962894 >>106967246 >>106968837 >>106968875 >>106968921 >>106970501 >>106972073 >>106972201 >>106972463 >>106975361 >>106976059
Why are C++ boomers like this? Can they get anything right?
Anonymous No.106956407 [Report]
>>106956287 (OP)
I have never used <ranges> and I don't plan to. What is wrong with the code?
Anonymous No.106956413 [Report] >>106958449 >>106959028
>>106956287 (OP)
Holy shit, C++ and Rust are the same language.
Anonymous No.106956424 [Report]
>>106956287 (OP)
List processing without using lisp or scheme. LOL, get educated.
Anonymous No.106956435 [Report] >>106961071
The sad thing is I don't even know what's wrong with the C++ one, but I'm also not surprised. Most new C++ features are pure garbage that are unusable. I don't know why people seethe about Rust so much. It basically just works, even if it lacks some minor meme features that C++ has that maybe let you get a few hundred nanoseconds or some shit in performance.
Anonymous No.106956461 [Report]
Amazon Web Services:
>switches to Rust
>outages
Anonymous No.106956491 [Report]
>>106956287 (OP)
Did they really overload the bitwise OR operator to use it as a shell pipe? What an abomination.
Anonymous No.106956511 [Report]
and i thought rust looked terrible. wow
Anonymous No.106956530 [Report]
>niggas ignoring the C++ code segfaults
I'm not the only one who noticed, right?
Anonymous No.106956535 [Report] >>106977214
>>106956287 (OP)
also keep in mind the rust program is only 12 lines of code while the c++ program is 13
Anonymous No.106956545 [Report] >>106956663 >>106956682
>>106956287 (OP)
Skill issue.
Anonymous No.106956663 [Report] >>106956925
>>106956545
So why is to_rvalue causing memory unsafely? It's being moved into the new array right? wtf is going on?
Anonymous No.106956682 [Report] >>106956740
>>106956545
C++ in white hands always looks good. The problem isn't so much the language (although it is rough) but the current crop of programmers.
Anonymous No.106956740 [Report] >>106956925 >>106956939
>>106956682
So are you brown? Why is no one explaining this shit? The rust shit makes perfect sense and it works. What the FUCK is the C++ shit doing?
https://en.cppreference.com/w/cpp/ranges/as_rvalue_view.html

The examples don't help either.
Anonymous No.106956750 [Report] >>106956807
>>106956287 (OP)
Any C++ programmer who writes code that looks anything like that deserves death anyway.
Anonymous No.106956807 [Report] >>106957013 >>106961929
>>106956750
That's what modern C++ looks like
Anonymous No.106956925 [Report] >>106960107 >>106974226
>>106956663
Strings own memory, so don't cast them to rvalues unless you want memory to be pilfered when objects are constructed/assigned from it. C++ ranges avoid copying as is, so you're messing with the lifetimes of non-owning references and getting surprised when it blows up on you.
In this case, why convert to a vector at all? You can just use std::views::filter(large) | std::views::reverse.
>>106956740
Learn what an rvalue is, xister.
Anonymous No.106956939 [Report] >>106956954 >>106956956 >>106960039 >>106960107
>>106956740
The segmentation fault occurs because std::views::as_rvalue causes the program to move strings from the original cities vector while the filter view is still iterating over it. As each string is moved, its internal state is altered (e.g., its size becomes zero), which violates the assumptions of the filter view that is trying to find the next element based on the original string sizes. This leads to invalid iterator behavior and an attempt to access invalid memory, causing the crash.
Anonymous No.106956954 [Report] >>106959115 >>106960859 >>106976314
>>106956939
>you can create iterator invalidation with this "new" ranges feature
Tell me again why C++ isn't a meme?
Anonymous No.106956956 [Report] >>106956983
>>106956939
But moving strings doesn't invalidate iterators of the original vector.
Anonymous No.106956983 [Report] >>106957009
>>106956956
as_rvalue, combined with the final conversion to a new vector, moves the content out of the strings in the original cities vector while the filter view is still conceptually iterating over it. Because the filter predicate depends on the string's size, moving a string changes its size to zero, which corrupts the logic of the filter's ongoing search for the next matching element and leads to undefined behavior.
Anonymous No.106956999 [Report]
>>106956287 (OP)
1. C++ shit
2. use python
Anonymous No.106957008 [Report] >>106957081 >>106960256 >>106961966
>>106956287 (OP)
so i'm a nocoder, here's my coomtribution
Anonymous No.106957009 [Report] >>106957046
>>106956983
This explanation makes no sense. First, filter must process element before it is passed to the next layer, so moving it shouldn't affect the logic at all. And even if it does, the size will be zero, so the output might be wrong, but it should not cause segfault. And iterators should not be invalidated anywhere in this code.
Anonymous No.106957013 [Report]
>>106956807
no one sane writes modern C++
Anonymous No.106957046 [Report] >>106957074 >>106957081
>>106957009
the fact that you're even engaging in this conversation is just proof this functional style retardation is extremely niggerlicious and you should just write it out the normal way
Anonymous No.106957074 [Report]
>>106957046
Never used ranges and never cared about them. But I feel like this is a bug in the implementation. Not surprising, given that nobody uses ranges...
Anonymous No.106957081 [Report] >>106957105 >>106957117 >>106960162
>>106957046
Or maybe Rust heems C++ so badly all you have left is a mockery of what you wish you could be. It's literally a fucking strawman feature, "um we couldn't do it right so obviously no one can." So people go back to writing ass like >>106957008
Anonymous No.106957105 [Report]
>>106957081
>i just like, cast things to rvalues for no reason
>idk like, i saw it one time in some other context
>OMFG IT SEGFAULTED I NEED TO CUT MY COCK OFF NOW REEEEEEEEEEEEEEEEEEEE
so rustrannies really are like this...
Anonymous No.106957117 [Report] >>106957173
>>106957081
C++ is a mess for sure, but all of this shit is full retard. god forbid people write things in the most simple and sane way that makes flow control as obvious as possible
Anonymous No.106957128 [Report] >>106957188
>>106956287 (OP)
considering they're the same ones who supported having a prez that is now indulging in his scat fetish via ai videos?
no. no they cannot.
Anonymous No.106957173 [Report] >>106957245
>>106957117
How is the Rust example hard to read? The rust example extends to all monadic types as well, like Result and Option, etc.
Anonymous No.106957188 [Report] >>106957192
>>106957128
>scat fetish
Very hinduphobic sir. He was merely unloading his bowels on the designated shitting street.
Anonymous No.106957192 [Report]
>>106957188
Scat fetish.
Anonymous No.106957204 [Report] >>106957306
>>106956287 (OP)
That C++ main function is UB. Fix the return value before any further analysis.
Anonymous No.106957228 [Report]
>>106956287 (OP)
std::for_each(std::rbegin(cities), std::rend(cities), [](auto const& c) { if (c.size() > 5) printf("%s\n", c.data()); }); fuck off
Anonymous No.106957245 [Report]
>>106957173
sarrr().please().do_the_needful() will always be more difficult to read, understand what is actually happening and predict what the compiler is going to output than just doing a fucking for loop like a normal person
Anonymous No.106957306 [Report]
>>106957204
Gcc injects return 0 automatically
Anonymous No.106957952 [Report] >>106960127 >>106960568 >>106962213
>>106956287 (OP)
Still on C++17, so I'd probs go for something like
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

int main() {
std::vector<std::string> cities{"Amsterdam", "Berlin", "Cologne", "LA"}, sub;
std::copy_if(cities.rbegin(), cities.rend(), std::back_inserter(sub),
[](const std::string &s) { return s.length() > 5; } );

for(const auto &s : sub) { std::cout << s << '\n'; }
}
Anonymous No.106958361 [Report]
>>106956287 (OP)
This shit is more unreadable than APL
Anonymous No.106958374 [Report]
>>106956287 (OP)
Usecase for having to learn some random trannies personal FSH to get a simple program written?
Anonymous No.106958449 [Report] >>106960686
>>106956413
Not really. Rust iterators are lazy. They don't do anything until you call a function that uses them or you loop through them.

That means instead of collecting a reversed list into a vector or doing doing in place operations before passing the data, you can just pass an reverse iterato. It's super cheap and it's a 4-8 byte copy.

Rust is lazy, which is why it's fast. It does nothing until you actually need to use the data.
Anonymous No.106958635 [Report]
>>106956287 (OP)
ranges are awful. but this can be fixed by putting reverse first.
why? i dont know.
Anonymous No.106958833 [Report] >>106958983 >>106960203
it doesn't need to be complicated

#import <stdio.h>
#import <string.h>

int main() {
char* cities[] = {"Amsterdam", "Berlin", "Cologne", "LA", ""};

for (int i=0; cities[i][0]; i++) {
if (strlen(cities[i]) > 5)
printf("%s\n", cities[i]);
}
}
Anonymous No.106958908 [Report]
>>106956287 (OP)
I like how nobody noticed this
Anonymous No.106958954 [Report] >>106975067
godbolt threads on /g/ are the equivalent of console wars or steam charts threads on /v/
nothing good will ever come out of them
Anonymous No.106958983 [Report] >>106960136 >>106960749 >>106960801 >>106964408
>>106958833
>O(N) strlen
Actual clown
Anonymous No.106959009 [Report]
const std = @import("std");

pub fn main() void {
const cities = D: {
comptime var cities: []const []const u8 = &.{};
inline for (&.{"Amsterdam", "Berlin", "Cologne", "LA"}) |city| {
if (city.len > 5) cities = cities ++ .{city};
}
break :D cities;
};
for (cities) |city| std.log.info("{s}", .{city});
}

Just filter the cities out compile time
Anonymous No.106959028 [Report]
>>106956413
Pretty much. The only thing rust gets credit for is that it's initialization doesn't require 10 years of study to understand. But otherwise they are both kitchen sink languages.

c++26 will look even more increasingly rust:
https://brevzin.github.io/c++/2024/09/30/annotations/
https://brevzin.github.io/c++/2025/05/02/soa/
Anonymous No.106959047 [Report]
>>106956287 (OP)
>as_rvalue
play stupid games nigger
Anonymous No.106959066 [Report]
That's not how let works, that's a chinese ripoff let

Also rust is slow as molasses, I gave a rust program a try and it took half a minute or something to load whereas the C equivalent loaded almost instantly

They say rust is almost as fast as C but that's nonsense
Anonymous No.106959115 [Report]
>>106956954
cope harder you retarded ass brainlet
Anonymous No.106959134 [Report] >>106959164 >>106960836
>>106956287 (OP)
>auto main() -> int
wtf is this? you let the compiler deduce the return type but you also hint it's int? i hate modern c++ so much it's unreal
Anonymous No.106959148 [Report]
>>106956287 (OP)
Why the fuck did you include as_rvalue? Your Rust version has no equivalent. You are deviating in C++ with an unnecessary move that is asinine and retarded, and then trying to make it seem as through it's the languages fault that you fucking stupid. Delete this thread, faggot.
Anonymous No.106959164 [Report] >>106959279 >>106960142
>>106959134
It's not a hint you fucking retard. It's a universal syntax and it even solves longstanding issues that plagued C++ going back to C called the most vexing parse. Pretend "auto main() -> int" is "fn main() -> int" because it means the same fucking thing you god damn drama queen.
Anonymous No.106959178 [Report] >>106959395 >>106964463
>>106956287 (OP)
Why are c++ and Java boomers always using light mode? Do they know something we don’t know?
Anonymous No.106959279 [Report] >>106960152
>>106959164
why not just... int main()? op doesn't even return shit
Anonymous No.106959365 [Report]
>>106956287 (OP)
No C++ boomer writes a cpp code like you did. Your pic showcases how zoomernoobs do it.
Anonymous No.106959393 [Report] >>106959432
import sequtils
let cities = ["Amsterdam", "Berlin", "Cologne", "LA"]
let sub = cities.filter(proc (s: string): bool = s.len > 5)

for s in sub:
echo s


With some added sugar it becomes
import sequtils
import sugar
let cities = ["Amsterdam", "Berlin", "Cologne", "LA"]
let sub = cities.filter( (s: string) => s.len > 5)

for s in sub:
echo s
Anonymous No.106959395 [Report] >>106960112 >>106960114 >>106960466
>>106959178
you parse text better on light backgrounds.
why do you think physical books have them?
Anonymous No.106959432 [Report] >>106959782
>>106959393
you can use `filterIt` to avoid having to manually define your inner proc.
https://nim-lang.org/docs/sequtils.html#filterIt.t%2Cuntyped%2Cuntyped
import sequtils
import sugar
let cities = ["Amsterdam", "Berlin", "Cologne", "LA"]
let sub = cities.filterIt( it.len > 5)

for s in sub:
echo s
Anonymous No.106959443 [Report]
>>106956287 (OP)
I dunno OP. it works on my machine when I don't try to deliberately break it.
Anonymous No.106959782 [Report]
>>106959432
Nice, Also saves the sugar import.
import sequtils
let cities = ["Amsterdam", "Berlin", "Cologne", "LA"]
let sub = cities.filterIt( it.len > 5)

for s in sub:
echo s


The only downside I see is that when you change cities to an array of something else with a .len, like a nested array, it still compiles.
Anonymous No.106960027 [Report]
>>106956287 (OP)
in Clojure this is just
Anonymous No.106960039 [Report]
>>106956939
C++ is a fucking meme lmao.
Anonymous No.106960068 [Report]
>daily "retards filtered by C++" thread
Anonymous No.106960107 [Report]
>>106956925
>>106956939
So basically, OP did some pointless niggerlicious garbage in a language he didn't understand, and got burned for it. I fail to see how this is C++'s problem.
Anonymous No.106960112 [Report]
>>106959395
It's cheaper
Anonymous No.106960114 [Report]
>>106959395
huh?
Anonymous No.106960117 [Report]
I swear 99% of C++ jeets don't know what basic principles such as memory ownership or scopes mean.
Anonymous No.106960118 [Report]
>>106956287 (OP)
>taking sepples seriously in 2025
Anonymous No.106960127 [Report] >>106960141
>>106957952
Sepples fags will tell you this is a high level language.
Anonymous No.106960136 [Report]
>>106958983
It's replaced by sizeof - 1 for compile-time constant strings.
Anonymous No.106960141 [Report] >>106960155
>>106960127
it literally is, according to every single conceivable definition of the term.
Anonymous No.106960142 [Report]
>>106959164
C never had the most vexing parse, it's 100% Sepples-exclusive insanity.
Anonymous No.106960152 [Report] >>106960839
>>106959279
Because there are a few cases that require trailing return type, and it's better to use the same syntax everywhere. So you should just use trailing return type.
Anonymous No.106960155 [Report]
>>106960141
>literally creates problems that don't exist at lower levels
I'll stick to low level code then.
Anonymous No.106960162 [Report]
>>106957081
Oeople who don't know what an rvalue is won't be converting to rvalue for no reason.
Anonymous No.106960203 [Report] >>106960223 >>106960239 >>106960749 >>106960885
>>106958833
Wait! So this is ALL that the code in OP is trying to doing? For real?
Why so much complexity, then? Why are modern languages re-inventing the wheel, for the worst?
Anonymous No.106960223 [Report]
>>106960203
Why do you hate the economy?
Anonymous No.106960235 [Report] >>106960251
Sirs

package org.example;

import java.util.ArrayList;
import java.util.List;

public class Main {

private static final CitiesPrinter citiesPrinter = new CitiesPrinter();

public static void main(String[] args) {
List<City> citiesList = new ArrayList<>();
citiesList.add(new City("Berlin"));
citiesList.add(new City("Amsterdam"));
citiesList.add(new City("Cologne"));
citiesList.add(new City("LA"));

citiesPrinter.printCities(citiesList);
}
}
package org.example;

import java.util.List;

public class CitiesPrinter {
public void printCities(List<City> citiesList) {
for(City city: citiesList) {
if(city.isAtLeastFiveLettersLong()) {
System.out.println(city.getCityName());
}
}
}
}

package org.example;

public class City{
private String name;

public City(String name) {
this.name = name;
}

public String getCityName() {
return name;
}

public void setCityName(String name) {
this.name = name;
}

public boolean isAtLeastFiveLettersLong() {
return name.length() >= 5;
}
}
Anonymous No.106960239 [Report] >>106960443 >>106960489 >>106961091
>>106960203
OP's code is also putting it in a new vector, in reverse order.
Anonymous No.106960251 [Report]
>>106960235
Where's your AbstractFactoryFactory? You're fired.
Anonymous No.106960256 [Report] >>106962884
>>106957008
that looks fine to me.
very readable.
Anonymous No.106960443 [Report] >>106960489
>>106960239

How about classic C++ ??


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using std::cout;
using std::endl;
using std::string;
using std::vector;

int main(){

vector<string> cities = {"Amsterdam", "Berlin", "Cologne", "LA"};
vector<string> cities_out;

for (size_t i = 0; i < cities.size(); i++){
string city = cities[i];

if (city.size() > 5){
cout << city << endl;
std::reverse(city.begin(), city.end());
//cout << city << endl;
cities_out.push_back(city);
}
}

return 0;
}
Anonymous No.106960466 [Report] >>106960527
>>106959395
> why do you think physical books have them?
Because ink consumption will increase by several orders of magnitude, stupid jeetger
Anonymous No.106960489 [Report] >>106961091
>>106960239
>>106960443

my bad:

#include <iostream>
#include <string>
#include <vector>

using std::cout;
using std::endl;
using std::string;
using std::vector;

int main(){

vector<string> cities = {"Amsterdam", "Berlin", "Cologne", "LA"};
vector<string> cities_in_rev;

for (size_t i = 0; i < cities.size(); i++){
string city = cities[i];

if (city.size() > 5){
cout << city << endl;
cities_in_rev.insert(cities_in_rev.begin(), city);
}
}

return 0;
}
Anonymous No.106960527 [Report] >>106960613
>>106960466
>you have to use black ink to make black paper
Anonymous No.106960555 [Report] >>106963458 >>106964074
>>106956287 (OP)
>I can't code and I hekin love Pust!
why are Pust shills like this?
Anonymous No.106960566 [Report]
you have to use black ink to make black paper
Anonymous No.106960568 [Report]
>>106957952
Probably more-efficient as well. You should probably use a const container + const iterators for your source container for better compiler optimizations. Obviously trivial in this example, but can make a big difference in realworld code. Cheers.
Anonymous No.106960613 [Report] >>106960922
>>106960527
All technologies and production chains are built around the production of white paper, even printing white on black will cost you ten times more, which is not commercially viable, nigger
Anonymous No.106960686 [Report]
>>106958449
Ah yes, lazy evaluation. The idiot's choice.
Anonymous No.106960749 [Report] >>106960809 >>106961209
>>106958983
Are you telling me the s.len() or s.size() is any different?
>>106960203
In one interview Bjarne admitted one of the reasons of making C++ was to keep programming elitist by making it overly complicated. Ironic since a common criticism of rust is that it's overly complicated.
Quite the niggerlicious twist of irony.
Anonymous No.106960788 [Report]
>>106956287 (OP)
I use c++ as in a better c, not for the c++ pajeetware you present here. look at this code, fucking retarded, just use a for loop
Anonymous No.106960801 [Report]
>>106958983
worse, it doesn't even create a new list with the results, also doesn't reverse either, kek.
Anonymous No.106960809 [Report] >>106961091
>>106960749
>Are you telling me the s.len() or s.size() is any different?
yes? do you know how C even works retard?
There is a reason everyone does Pascal Strings circa, 1980.
Anonymous No.106960836 [Report] >>106961230
>>106959134
this is the practice recommended by Herb himself and has been in the language since C++11.
the biggest plus with it is it avoids having to specify the qualified path twice, one for the function decl and the return decl.
Anonymous No.106960839 [Report] >>106961234
>>106960152
I see. Never used it myself, I'm still stuck in the C++14 timeline. Any good resources on the new stuff, besides the official docs/drafts?
Anonymous No.106960859 [Report] >>106960875
>>106956954
>use the language wrong
>waaaaaaaaagh why is the language not working
Anonymous No.106960875 [Report]
>>106960859
how is it being used wrong? actually show a detailed analysis or a plausible, testable in gdb, hypothesis. The Rust compiler will tell you if you're doing something wrong, so it isn't even possible to fuck this up there, no matter where the reverse filtering occurs in this range/iterator/whatever you want to call it.

you can't, because you're just another incompetent DEI Jeet who seethes about Rust superiority and can't accept that you might not know a whole lot.
Anonymous No.106960885 [Report] >>106960921 >>106961091
>>106960203
C++/rust are academia / commitee driven design, the sort of slow this creates is "having a cute idea and forcing it into everything".

For maximum productivity I recommend just sticking with a chosen subset C++, make the code look like C for the most part. That is assuming you need a systems programming language, typescript java are all fine options also.
Anonymous No.106960921 [Report]
>>106960885
>I recommend just sticking with a chosen subset C++, make the code look like C for the most part.
Objectively worse than just using C.
Anonymous No.106960922 [Report]
>>106960613
That's cost, not ink consumption.
Different metrics.
Anonymous No.106961009 [Report] >>106961020 >>106966852
>no warnings either
kwab the language

~/.l/tmp> g++ -std=c++23 -Wall -Wpedantic -Wextra x.cpp
~/.l/tmp> ./a.out
fish: Job 1, './a.out' terminated by signal SIGSEGV (Address boundary error)
Anonymous No.106961020 [Report]
>>106961009
forgot to mention, it took a gorillion years to even compile.
Anonymous No.106961032 [Report] >>106962004
>>106956287 (OP)
So many "std"s.
Anonymous No.106961071 [Report]
>>106956435
Rust is way better than c++ unless you have to work with raw pointers.
Anonymous No.106961083 [Report] >>106961200
C++ version doesn't look so bad, but it could be formatted better with some line breaks. It's basically shell syntax.
Anonymous No.106961091 [Report] >>106961182 >>106961700
>>106960809
Press X to doubt. As if my compiler can't figure out I'm running a standard function on a constant string.
>>106960239
>>106960489
it still doesn't need to be complicated.
#import <stdio.h>
#import <string.h>

int main() {
char* cities[] = {"Amsterdam", "Berlin", "Cologne", "LA"};

for (int i=sizeof(cities)/sizeof(cities[0]); i; --i) {
if (strlen(cities[i-1]) > 5)
printf("%s\n", cities[i-1]);
}
}

This thread made me realize modern language developers are the nuancebros of the programming world.
>if things were different they would, indeed, be different
>if our usecase was different our implementation should, indeed, include a solution for it
>>106960885
>For maximum productivity I recommend just sticking with a chosen subset C++, make the code look like C for the most part.
This. Take the good parts of C++ so you don't come off as an absolute autist, but also don't get lost in the sauce.
Anonymous No.106961182 [Report] >>106962329
>>106961091
>sizeof(cities)/sizeof(cities[0])
>i as loop condition
>indexes with i-1
>is too retarded to realize why no one cares about his compiler optimizations for the baby shit easy const char* literal case
>still doesn't build an intermediate vector of the results of his smelly shit code

Cniles are literally the dumbest niggers on /g/
Anonymous No.106961200 [Report]
>>106961083
it honestly isn't the worse and it adds the flexibility that Rust's iterator traits offer without a lot nested function call cancer you'd see with the old <algorithms> approaches to the samish problems.
the problem is, it segfaults because it's hard to use correctly.
Anonymous No.106961209 [Report]
>>106960749
>In one interview Bjarne admitted one of the reasons of making C++ was to keep programming elitist by making it overly complicated
Rustroon, pls. My guess is you weren't even aware that was a parody. Bjarne even addressed that specific caricature during an interview.
Anonymous No.106961230 [Report] >>106961236
>>106960836
It also has a general, 'unifying the syntax' benefit (similar to auto).
Anonymous No.106961234 [Report]
>>106960839
Tour++.
Anonymous No.106961236 [Report] >>106961259
>>106961230
I agree. I use auto literally everywhere because it's more readable anyway.
Anonymous No.106961259 [Report]
>>106961236
auto keyword (the new one, ofc) was a real godsend for complex types -- typically iterators of specified containers. And of course for unnamable types (basically, lambda results) it's essential.

I've found that it occasionally also benefits code maintenance in downstream code if I need to change some type upstream.
Anonymous No.106961700 [Report] >>106961744 >>106962329 >>106972108
>>106961091
Guess you could do something like this:
#import <stdio.h>
#import <string.h>

int main() {

char* cities[] = {"Amsterdam", "Berlin", "Cologne", "LA"};
char* cities_in_rev[sizeof(cities)] = {0};
int size_of_rev = 0;

for (int i=sizeof(cities)/sizeof(cities[0]); i; --i) {
if (strlen(cities[i-1]) > 5){
printf("%s\n", cities[i-1]);
cities_in_rev[size_of_rev++] = cities[i-1];
}
}
}

This potentially allocates a lot of unnecessary stack memory, of course.
Anonymous No.106961744 [Report]
>>106961700
char* cities_in_rev[ sizeof(cities)/sizeof(cities[0]) ] = {0};
Anonymous No.106961929 [Report] >>106962213
>>106956807
if you remove the "std::" and the shitty "::" syntax it would've been more readable by a long shot
a quick glance to C++ code is always a fucking headache, you always need few seconds to readjust to the extra garbage
what a fucking waste of resources
Anonymous No.106961966 [Report] >>106962052 >>106962884
>>106957008
why can't you iterate in reverse order in the first place and avoid the sorting? for loop doesn't have reverse mode?
Anonymous No.106962004 [Report]
>>106961032
one can say the language is ridden with stds
Anonymous No.106962052 [Report]
>>106961966
Functional programming was a mistake.
Anonymous No.106962213 [Report] >>106962572 >>106963553 >>106968824 >>106976109
>>106961929
With big codebases, it becomes irrelevant background, and explicitly specifying the namespace is very valuable during maintenance.

That said, it's traditional form to use shortened names within the scope of function bodies. Thus >>106957952 becomes:

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using std::back_inserter;
using std::copy_if;
using std::cout;
using std::string;
using std::vector;

int main()
{
vector<string> const cities{"Amsterdam", "Berlin", "Cologne", "LA"};
vector<string> sub;
copy_if(cities.crbegin(), cities.crend(), back_inserter(sub),
[](auto const& s) { return s.length() > 5; });

for (auto const& s : sub)
cout << s << '\n';
}

With such a short function body, it hardly matters. But for complex function a screen or two in size, such tweaks improve readability significantly.
Anonymous No.106962329 [Report] >>106962390
>>106961182
Larping nocoder award
>>106961700
I don't get why we have to rebuild cities when it's processed the same way.
This is why I'll never get a job in tech. I don't need a liberal college student or H1B visa breathing down my neck to make an inferior product to justify their interests.
Anonymous No.106962390 [Report] >>106962533 >>106962652
>>106962329
>I don't get why we have to rebuild cities when it's processed the same way.
You don't. Particularly with ranges, you can simply compose the original in the chain for the output you want, with no intermediaries. OTOH, it's a traditional form to follow the source->target containers, and much easier to reason about in complex situations -- if less-efficient memory-wise.
Anonymous No.106962533 [Report] >>106962652
>>106962390
>if less-efficient memory-wise.
That said, such a source->target containers scheme generally executes faster, vs. a bunch of pointer-chasing necessary to do things the """efficient""" way.
Anonymous No.106962572 [Report] >>106962595
>>106962213
>copy_if
Anonymous No.106962595 [Report]
>>106962572
Yes? It exactly matches the algorithm needs to solve the problem, and does so concisely in this case.

https://en.cppreference.com/w/cpp/algorithm/copy.html
Anonymous No.106962637 [Report] >>106962667
>>106956287 (OP)
>.iter()
>.rev()
>.len()
Anonymous No.106962652 [Report]
>>106962390
>>106962533
I'm not too concerned about memory usage desu. It's kind of hard to use an insane amount of memory when working with plain C. I'll just use whatever method works best for what I'm trying to do.
Is it a list of names to be filtered by roles? A multidimentional array will do.
Is it a file listing that needs to be sorted by name, size or date? Let's build an array of pointers for each case.
Anonymous No.106962667 [Report] >>106964592
>>106962637
>len(rev(iter(x)))
Anonymous No.106962884 [Report] >>106962962 >>106963126
>>106961966
aye, afaik for with auto doesn't have the reverse mode
>>106960256
this problem does not need fp imo, it's just too basic
it isnt a tree walker, isnt recursion, isnt math and isnt lambda calculus, it also isnt expressed better by a bunch of pipelined transformations
t. same anon
Anonymous No.106962894 [Report] >>106968586
>>106956287 (OP)
Just use Python if you're making worthless meme scripts
Anonymous No.106962962 [Report] >>106963126
>>106962884
also i think i got filtered by a normal for loop, the condition seems iffy
Anonymous No.106963126 [Report]
>>106962962
>>106962884
and also i think there's an issue with dynamic allocation by 1 unit of memory in a loop. i've heard it's costly. so small container copies get allocated the full size of their parent container, and then get resized to actually required capacity. iirc
Anonymous No.106963458 [Report]
>>106960555
/thread
Anonymous No.106963553 [Report] >>106968586
>>106962213
Jesus Christ.
Anonymous No.106964074 [Report] >>106968794
>>106960555
checked
anyway, now i want to write more stuff like this. how do i get started anons?
Anonymous No.106964408 [Report] >>106964672 >>106972187
>>106958983
oh no, an O(n) for a simple as hell function where N doesnt realistically grow larger than 10 (unless you are interested in Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch, for whatever reason), it's the end of the world, let's hope our City Name Parsing as a Service (aka CNPaaS) doesnt go down because of this
Anonymous No.106964463 [Report]
>>106959178
yeah, light mode is superior :)
Anonymous No.106964592 [Report]
>>106962667
>Chad keeps an eye on Niger
Anonymous No.106964672 [Report] >>106964782
>>106964408
Why do people get so hung up over O(xyz) when a single cache miss can make your perfect algo slower than the most dump step by step approach?
Anonymous No.106964782 [Report]
>>106964672
I can see it being a useful metric sometimes, but treating it as something sacred is idiotic, as it is not a measure of speed but a measure of time growth
Anonymous No.106966852 [Report]
>>106961009
C++ in a not a safe language
Anonymous No.106967246 [Report] >>106968304 >>106968716 >>106968821
>>106956287 (OP)
what programming to learn for embedded stuff but also allow me to extended beyond just piece of code?
C? Rust? Zig? Go?
I don't like C++ I used it years ago, python is shit, I like rust that you can also make front ends but open to suggestions
Anonymous No.106968304 [Report] >>106968599 >>106968824
>>106967246
Zig's looking pretty good. Rust is also strong due to having stackless coroutines, but everything else about rust kinda sucks.
Anonymous No.106968586 [Report]
>>106962894
With such a meme example as OP's, thats fair enough. At an industrial scale, C++ is the White man's choice.

>>106963553
Is Lord of all?
Anonymous No.106968599 [Report]
>>106968304
The r*st community is the worst thing about the language. The obtuse syntax is a follow-on second worst thing.
Anonymous No.106968716 [Report] >>106968824
>>106967246
>for embedded stuff
No matter what hardware you're working on a C compiler is always available.
Anonymous No.106968794 [Report]
>>106964074
Like what? Useless code by a dumb OP?
LeetCode is a better waste of time.
Anonymous No.106968821 [Report]
>>106967246
C is universal.
People complain because people want to just have to import the solution.
Anonymous No.106968824 [Report]
>>106968304
thanks
>>106968716
I like C but it's limited beyond having a c code, you will always have to learn another lang to build a platform.
For example, a couple years ago I built a platform to do stuff with drones, but the code was cluster fuck, the embedded stuff in C++, and had to compile it as a binary blob called by the server side code I did in nodejs, I also had some golang/python for some payload, plus all the front end work. So I am trying to have one lang or max to to rebuild the whole thing again. so I don't mind converting C++ to rust and make the whole codebase rust.
like I converted this code >>106962213 to rust using AI and gave me this
use std::collections::HashSet;

fn main() {
let cities = vec!["Amsterdam", "Berlin", "Cologne", "LA"];
let mut sub: Vec<&str> = Vec::new();

sub.extend(cities.iter().filter(|&&city| city.len() > 5));

for city in sub {
println!("{}", city);
}
}
and it did compile and worked great, if I can convert what I did before and it does 80% of the job and manually do the rest I will be happy
Anonymous No.106968837 [Report]
>>106956287 (OP)
There is an intersection between C and C++ where everything is right, but it's a painful and difficult.

Then moving in between assembly does provide additional benefits.
Anonymous No.106968875 [Report]
>>106956287 (OP)
Your watered down language is nowhere near where it needs to be to be useful. You need to escape the programming paradigm you are locked into. Return to notepad and compiler, that way you can keep, organize and review your own code.

Next you need to stop jumping between languages.
Anonymous No.106968921 [Report] >>106972235
>>106956287 (OP)
Some C++ designs are terrible, the vector is just terrible. It's not good for anything, using basic datatypes is better, there is better complex designs.

The practicality of the vector is that it is just there and it can get around the limited datasize of arrays as the type is dynamic. So you may use it simply to get around that issue.

It is however only useful as a beginner datatype to simplify things.
Anonymous No.106968949 [Report]
The thing is about starting off with the vector, is that you will grow accustomed to use the vector datatype, this may shunt your ability to design more complex systems in the future as the vector is just comfortable, easy but not scalable.
Anonymous No.106970501 [Report] >>106972119 >>106972188 >>106972551
>>106956287 (OP)
how does that look like in a modern langauge like Beef or zig?
Anonymous No.106972073 [Report]
>>106956287 (OP)
Just add using namespace std::views and std::ranges, then the code is very similar:
std::vector<std::string> cities{"Amsterdam", "Berlin", "Cologne", "LA"};
auto sub = cities
| filter([](const auto& s){ return s.size() > 5; })
| reverse
| to<std::vector>();
Anonymous No.106972108 [Report]
>>106961700
"Allocating" more than required stack memory is far more efficient than allocating a vector so its still better
Anonymous No.106972119 [Report] >>106972188
>>106970501
zig doesn't have functional programming concepts in the standard library nor in the language
Anonymous No.106972187 [Report] >>106974679
>>106964408
these are the retards that made GTA V loading screens longer than necessary. take notes everyone. Cniles are so unhinged.
Anonymous No.106972188 [Report]
>>106970501
>>106972119
This is how it would look like in zig. Its regular procedural code similar to C.
Anonymous No.106972201 [Report]
>>106956287 (OP)
Having coded in pyhton as well. C++ is the best language, you actually declare what your integers or floats are, visible on the code
Anonymous No.106972235 [Report] >>106972258 >>106972552
>>106968921
What exactly is wrong with std::vector?
Anonymous No.106972258 [Report]
>>106972235
it's clearly too simple for him.
only thing immediately obviously bad is vector<bool>, but we don't talk about vector<bool>
Anonymous No.106972463 [Report]
>>106956287 (OP)
>no c++ experience

so you have to import standard lib vector and import standard string for usage in variable citites which is a vector, wtf is a vector?
wtf is auto???
so array large.. wtf is this const auto& s, but only return if string size is larger than 5?

phew okay lets continue
another auto shit, cities, but now you start piping shit?
so pipe standard::views, wtf is standard view used for?`so you somehow filter city names that size is larger than 5, then you pipe a reverse? and then as_rvalue?

wtf is r_value?
and now its pipe into range to empty standard vector

i will not even try to understand wtf the last for loop does.
Anonymous No.106972551 [Report]
>>106970501
no idea if this is good odin or not https://godbolt.org/z/7Yb6McY31
package main
import "core:slice"
import "core:fmt"

example :: proc(arr: []string ) -> []string {
res := slice.filter(arr[:], proc(i : string ) -> bool { return len(i) > 5;})
slice.reverse(res[:])
return res
}

main :: proc() {

cities := []string{ "amsterdam", "berlin", "tokyo"}
res := example(cities)
fmt.println(res)
}
Anonymous No.106972552 [Report] >>106972654 >>106975012 >>106975453
>>106972235
Won't use realloc. Even a 10-line DIY implementation is more efficient.
Anonymous No.106972654 [Report] >>106975234
>>106972552
That will only work for POD types though, won't it? No improvement is possible here for non-POD types.
Anonymous No.106974226 [Report]
>>106956925
Learn what an xvalue is, ruster.
Anonymous No.106974679 [Report] >>106974774
>>106972187
you're braindead, who let you out of the special ed class? your handlers will get angry if they see you on this basket weaving forum
Anonymous No.106974774 [Report]
>>106974679
eat a fucking bullet, you cnile piece of shit.
https://news.ycombinator.com/item?id=26296339
Anonymous No.106975012 [Report] >>106975114 >>106975180 >>106975234
>>106972552
No allocator ever implements realloc. They always implement realloc in terms of malloc, memcpy, and free. How exactly does this help with when a vector class can do the exact same thing? It doesn't. Now explain how you expect any type paradigm to cope with dynamic addressing whereby non-trivial objects can be secretly moved via some dumb cunt c allocator that doesn't even know what an object is.

You're actually retarded, much like the rest of this thread. At least when retarded children used to brag about "knowing cpp" and shit 5, 10, 15, 20 years ago, they'd get roasted for it. You and everyone around you are so shelted they cannot validate how much of an utter spastic you and your "10-line DIY implementation" are without getting banned by some pedophile jew janny. You're pathetic and should consider hanging yourself.
Anonymous No.106975067 [Report] >>106975318
>>106958954
A lot of stupid discussion on /g/ about performance and language differences could be resolved simply by looking at the assembly output.
Anonymous No.106975114 [Report] >>106975180 >>106977213
>>106975012
>They always implement realloc in terms of malloc, memcpy, and free. How exactly does this help with when a vector class can do the exact same thing? It doesn't. Now explain how you expect any type paradigm to cope with dynamic addressing whereby non-trivial objects can be secretly moved via some dumb cunt c allocator that doesn't even know what an object is.
nta
and i never done that so i might be talking out of my ass
BUUUUT
doesnt mmap allow you to choose the virtual addresses you get?
that way you dont even need to copy upon resizing
Anonymous No.106975180 [Report]
>>106975012
>>106975114
chud gpt says it can be done

imagine if you memelang-lets get your way and this know how disappears?
that would actually be pretty based now that i gave it a fink, any semi competent C-ultists will then be worth an upper 6digit salary
Anonymous No.106975234 [Report] >>106975310 >>106977213
>>106972654
Correct, but in practice std::vector is used with POD types 99% of the time. A template specialization could have done it, considering the mess they did do with the bool specialization.

>>106975012
Peak Dunning-Kruger. Please keep posting, never write code and never actually learn anything.
Anonymous No.106975310 [Report] >>106975356
>>106975234
>A template specialization could have done it, considering the mess they did do with the bool specialization.
Can you make a specialization for POD in general? Or only for a few particular cases?

>Correct, but in practice std::vector is used with POD types 99% of the time.
I don't think that is true at all. It may be true in particular applications, but across the broader C++ codebase I would be surprised if it was more than 50%. Vectors containing structs that contain strings, smart pointers, or further containers are all very common.
Anonymous No.106975318 [Report]
>>106975067
I have a boomer at work that keeps spouting retarded shit about "muh performance" and never even learned to read a single assembly instruction in any ISA.

>inb4 le zoomer who cares about that shit
Assembly (or for pedantic fags, its binary representation) is what the CPU ultimately accually executes.

No matter how fancy your language and compiler are, if the generated assembly is shit, performance will be shit. Which is why, if you *actually* care about performance, it is important to inspect the generated code.

If you don't really care that much about performance, you're wasting your time with Sepples or Rust. Use simpler language and get something done.
Anonymous No.106975333 [Report] >>106975389
How do C++ programmers even read this shit?
They claim Rust generic code is unreadable, but if I want to look what eg Iterator::copied() does I look at iterator: https://doc.rust-lang.org/std/iter/trait.Iterator.html
fn copied<'a, T>(self) -> Copied<Self>
where
T: Copy + 'a,
Self: Sized + Iterator<Item = &'a T>,

and it's pretty clear this function exists on an iterator of references for any type that can be copied. I can click at Copied to check what I get and see:
impl<'a, I, T> Iterator for Copied<I>
where
T: 'a + Copy,
I: Iterator<Item = &'a T>
{
type Item = T

And I learn that this method takes an iterator of references to T and returns iterator over Ts, presumably by copying them.
But with C++, you always /* unspecified */ fucking /* see below */ until /* undefined behaviour */
Anonymous No.106975345 [Report] >>106975477
decided to start learning c++. I nearly got filtered just trying to get shit to compile on vs code. Jesus christ.
Anonymous No.106975356 [Report]
>>106975310
>Can you make a specialization for POD in general? Or only for a few particular cases?
You MIGHT be able to do it with some TMP fuckery in later Sepples revisions (see std::is_pod), but admittedly I haven't tried myself.
Anonymous No.106975361 [Report]
>>106956287 (OP)
That's great go rewrite another library in your toy language.
Anonymous No.106975389 [Report] >>106975726
>>106975333
c programmer here
sepples is as unreadable as rust is to me
sepplets have no leg to stand on when readability is concerned

and by unreadable i dont mean i cant read it, but its tough to read compared to c
think: how hard is it to read when youre at your 14th hour of the day and the only things that keep you alive are adrenaline from a coming deadline, and caffeine
Anonymous No.106975453 [Report] >>106977213
>>106972552
>Won't use realloc. Even a 10-line DIY implementation is more efficient.
Except it's not because under the tight, non-deterministic circumstances in which reallocation in-place is even viable doesn't make up for the fact that your piece of shit 10-line implementation is going to make no use of constexpr meaning terrible inlining and absolutely no SBO or constant folding. Nice handrolled turd you fucking moron.
Anonymous No.106975477 [Report] >>106975763
>>106975345
most of that is because microsoft's toolchain is absolutely fucking terrible and designed to be exclusively used through Visual Studio proper.
Anonymous No.106975726 [Report] >>106975875
>>106975389
I do not have problem with syntax per se, I don't care about such superficial things.
What I have problem with are all these hand-wavy /* whatever */ blanks in documentation that require reading text to figure out what are they trying to accomplish.
Rust has everything specified formally. I can see the concrete types, arguments, generic bounds, etc. Even if a function doesn't specify a concrete return type, it will be declared as fn name() -> impl Trait + Trait + Trait which still precisely defines which (exclusively) kind of operations will be supported by the returned, instead of just being "whatever, figure it out yourself and pray the compiler will reject your code if you assume something wrong". Which is exactly what happened in OP code. I honestly doubt you can figure out what went wrong solely by looking at function definitions, without reading all the small print on each page.
Anonymous No.106975763 [Report]
>>106975477
Really felt that way. I'm so used to VSC I didn't want to change to VS. Eventually got it working. Had the compiler installed through VS build tools, and not VS, so for some fucking reason it couldn't find the compiler until I uninstalled VS...(or reinstalled it with C++ but my drive is low on memory and I need to move some shit around)
Finally can get to learning.
Anonymous No.106975875 [Report] >>106976729
>>106975726
>What I have problem with are all these hand-wavy /* whatever */ blanks in documentation that require reading text to figure out what are they trying
this is a 100% legit grievance to have about c. and things are even worse than what you describe.
this code
return (a + b + c + d)

is not equivalent to this code
return ((a + b) + (c + d))

even if from the standpoint of the standard, it should be
and nowhere in the standard this will be explained.

thing is
to be good at c you have to consider your compiler as part of the standard, and how it treats subtle-er hints like the above
thats the thing. its perfectly deterministic. but theres people who want c to be portable, and they ignore the fact that compilers also have features.

the parenthesis are a compiler hint which tells it the dependencies of operations, allowing it to, in turn, to write things in such a way that the processor makes optimal usage of its features.
this makes sense
what fucks things up is that were still stuck in the mythos that c is portable bc big corpo, and they want to be able to write once, run everywhere

its not cultists fault
that one is on big corpo
they forced us to divide c into "the idiomatic vanilla, boring shit", and "actual c"

on the other hand
i just fucking love using parenthesis to talk with the compiler
and this makes perfect sense bc order of operations maps directly to operation order duh.
but that in turn maps to operation dependency
which defines what can be out of ordered or instruction level parrallelismed
Anonymous No.106975931 [Report]
>which defines what can be out of ordered or instruction level parrallelismed
which is where the brilliant compiler people shine
and even the libc people are genius because they work with ALL the constraints
but its like
c is two languages
99% of people know idiomatic c
but that also means 99% of people not only use c, but wih a hand tied behind its back
but also dont appreciate the craftsmanship that actually goes into making c a thing

im drunk and emotional, but i find this sad
disss fukken sucks
Anonymous No.106975960 [Report]
>which is where the brilliant compiler people shine
bc asm is also mere hints
bc that shit gets reordered and such
preemptively executed and such
just as much as good c programmmers are c-whisperers
we wouldnt be shit wo the compiler people
bc theyre the asm-whisperers
bc even fukken asm/machine code is the same degree of abstract as c is to asm
ill never express enough respect to these people
sage No.106975969 [Report] >>106976037 >>106976747
#include <iostream>
#include <vector>

using namespace std;

int main() {
vector<string> cities = {"Amsterdam", "Berlin", "Cologne", "LA", ""};
for (int i = cities.size(); i--; i==0) {
if (cities[i].size() > 5)
cout << cities[i] << "\n";
}
}

retard
Anonymous No.106976037 [Report] >>106976052
>>106975969
wow, you're so clever and smart, like all the other posters ITT who posted equally shitty code.
if you don't understand iterators or why they exist, why are you posting ITT? even the <algorithm> solutions are less bad than yours.
sage No.106976052 [Report] >>106976070
>>106976037
>shitty code
where faggot?
Anonymous No.106976059 [Report]
>>106956287 (OP)
So this is the C killer language I've been hearing about? A slightly less bad C++? This isn't going to kill C for anyone who doesn't already hate C.
Anonymous No.106976070 [Report] >>106976095
>>106976052
all of it? do you understand what composability is? no, you probably don't, because you're a fucking idiot.
Anonymous No.106976095 [Report] >>106976109
>>106976070
still waiting for you to show me where the shit code is faggot, crying and putting buttplugs in your ass as a sissy rust tranny won't make your posts true
Anonymous No.106976109 [Report] >>106976150
>>106976095
it's literally worse than >>106962213 by a lot. on top of the fact, just like the retarded cnile, you didn't even copy/move the values into a new vector.
Anonymous No.106976150 [Report] >>106976166
>>106976109
how is it worse and why do I need to move them to output them? you're retarded and mentally ill
Anonymous No.106976166 [Report] >>106976192
>>106976150
>doesn't use rbegin
should be your first and only clue and as I already said, it does not behave the same as the OP's code.
Anonymous No.106976192 [Report] >>106976206
>>106976166
>execute the thing
>output is the same
>but hurr durr it didn't do the same
lmao cope, seethe and dilate tranny, no more (you) from me
Anonymous No.106976206 [Report] >>106976248
>>106976192
why are there so many retards who enter threads about C++ and Rust that don't know anything about either of those languages? no one fucking cares about your retarded quippy snippet, that's both tastefully incorrect C++ and technically incorrect as well. fuck off.
Anonymous No.106976248 [Report]
>>106976206
>tastefully incorrect c++
>tastefully
wut
Anonymous No.106976314 [Report] >>106976451
>>106956954
brown hands typed this
Anonymous No.106976451 [Report]
>>106976314
saar...
Anonymous No.106976550 [Report]
this is only slightly less unhinged than the learncpp comments.
Anonymous No.106976729 [Report] >>106977153
>>106975875
>this code
>return (a + b + c + d)
>is not equivalent to this code
>return ((a + b) + (c + d))
>even if from the standpoint of the standard, it should be
No it shouldn't? Parenthesis have higher precedence than addition and addition is evaluated from left to right. This might matter in types like floats where each operation comes with precision error.
Anonymous No.106976747 [Report]
>>106975969
>the solution to C++ problems is to not use C++
Always makes me chuckle.
Anonymous No.106977153 [Report]
>>106976729
>This might matter in types like floats where each operation comes with precision error.
didnt think of it but also: yes
point still stands though
theres stuff that isnt immediately obvious when youre dealing with c
also: the parenthesis are also important when you deal with ints
its about instruction level parallelism.
namely: execution slots. whose number i dont master per model, and per class
but iirc on a consumer cpu you can run 4 simple ops like mults or greater/smaller than at a time
or 2 avx ops
per ilp bc each has its own latency before running, so these dont translate into units of time
afaik, i dont know everything, only what concerns my code
Anonymous No.106977213 [Report]
>>106975234
>Peak Dunning-Kruger. Please keep posting, never write code and never actually learn anything.
You're a fucking drooler who can't answer why you think a crts memcpy is faster than a constexpr if trivial { memcpy } else { ... } in C++, kys.

>>106975453
That's just the thing. realloc just isn't a thing anywhere. Instead, you get morons like this babbling about "muh pod" and >>106975114 "muh mmap" to somehow grasp at nonexistent straws.

Why yes, I too think memcpy in crt = le good, memcpy behind std vector = le bad.

Why yes, I too think std::vector needs awareness of the runtimes primary allocator memory mapping strategy, just so that it can reserve non-backed virtually contiguous address space - using a syscall every time -- just to expand an array.

Why yes, I too use non-existent metaprogramming type descriptions (eg: "POD") that have been deprecated for fucking years, because I don't know what came after TR1.

Can we go back to lynching underaged faggots and incompetent shit stirrers on sight? We wouldn't so many of these cringe threads otherwise. I really cannot remember any era where this shit was acceptable on any forum, skype, or irc channel. Why do we tolerate it?
Anonymous No.106977214 [Report]
>>106956535
>a line in C++:
> auto sub = cities | std::views::filter(large) | std::views::reverse | std::views::as_rvalue | std::ranges::to<std::vector>();
>a line in Rust:
>.rev()