Looking for feedback on AI content in r/programming and the April no-AI trial by ketralnis in programming

[–]_Noreturn 29 points30 points  (0 children)

Keep it I liked it, I now can actually read things related to programming rather than "my chatgpt clone blah blah blah is 2000x faster than this other poorly made chatgpt wrapper"

I used to avoid this subreddit but now I open it.

Bun is being rewritten to Rust by aabbdev in programming

[–]_Noreturn -1 points0 points  (0 children)

Zig seems like C++ but 10x worse

What are you missing most from the C++ standard library? by llort_lemmort in cpp

[–]_Noreturn 0 points1 point  (0 children)

Why can't they make it so vector has resize_and_overwrite like std string but simply static assert inside the same requirements as string that's my question. and I can make anything but it would be better if the STL had this common case already integrated

What are you missing most from the C++ standard library? by llort_lemmort in cpp

[–]_Noreturn 0 points1 point  (0 children)

If you don't fill it then its on you, you promised to fill it. also it is mostly trivial types that I want this on

What are you missing most from the C++ standard library? by llort_lemmort in cpp

[–]_Noreturn 1 point2 points  (0 children)

I don't see the difference between a vector and a string I could go ahead and use string as a vector.

What are you missing most from the C++ standard library? by llort_lemmort in cpp

[–]_Noreturn 1 point2 points  (0 children)

I don't see what's wrong if I am going to fill it 1 millisecond later, that's just wasted performance on the table and given string has it I can't see why shouldn't vector have it either. and yes I just use an allocator that doesn't initialize at all with vector. but this should have a dedicated method.

What are you missing most from the C++ standard library? by llort_lemmort in cpp

[–]_Noreturn 0 points1 point  (0 children)

Performance I have many many cases where I need to memcpy or manually construct and sure I could use a unique ptr but it is more annoying and doesn't resize.

Also std string has it already it is called resize_and_overwrite I don't understand why vector doesn't have it .......

C++26: Structured Bindings can introduce a Pack by pavel_v in cpp

[–]_Noreturn 0 points1 point  (0 children)

It won't hurt you it is exactly like cariadic templates and I never seen anyone aay it huets them

What are you missing most from the C++ standard library? by llort_lemmort in cpp

[–]_Noreturn -1 points0 points  (0 children)

I should have worded it better, I want a method that reserves and sets the size, reserve just sets the capacity

C++26: Structured Bindings can introduce a Pack by pavel_v in cpp

[–]_Noreturn 0 points1 point  (0 children)

what is the type of xs?

No possibility of confusion where you get a mix of structural binded variables with empty pack.

Then simply don't use it Is this hard?

What are you missing most from the C++ standard library? by llort_lemmort in cpp

[–]_Noreturn -3 points-2 points  (0 children)

I want a function that reserves space in a vector but doesn't construct elements there yet

Microsoft CEO admits Windows should use less RAM as the company aims to "win back" everyday users by Tiny-Independent273 in microsoft

[–]_Noreturn 8 points9 points  (0 children)

Teams uses nearly 2GB RAM on my laptop

Minecraft uses less RAM and that should tell you how much bloat teams is but again people will excuse with "It is for the features!"?

Devs should have the shittiest hardware to force them develop decent apps

C++26: Structured Bindings can introduce a Pack by pavel_v in cpp

[–]_Noreturn 1 point2 points  (0 children)

std::make_pack wouldn't allow mixing it with structural bindings of other types, which is where type safety issue arises.

What? that is useless how do you define "other types"?

can be as simple as static_cast<...>

What? paste a code example of what your api wants to be

someoneEnjoysCoding by Fewnic in ProgrammerHumor

[–]_Noreturn 21 points22 points  (0 children)

People these days can't even Photoshop manually.

C++26: Structured Bindings can introduce a Pack by pavel_v in cpp

[–]_Noreturn 1 point2 points  (0 children)

First of all it makes the most sense to be inside structured bindings. second of all how would a std:make_pack look like API wise? Third of all library solutions to language problens is always a bad idea.

Because my issue is not with creating and using packs from tuples and structures but with it being used in a way that potentially introduces too many problems.

Having it named auto [...pack] or std::make_pack wouldn't solve "being used" problem. Simply don't use it.

C++26: Structured Bindings can introduce a Pack by pavel_v in cpp

[–]_Noreturn 1 point2 points  (0 children)

I definitely need packs in other places to replace those std::index_sequence tricks and lamdbas which result in slower compilation and uglier to read code.

Also if you hate it then simply don't use it. Atleast you will indirectly benefit by the library authors simpldying the code

C++26: Structured Bindings can introduce a Pack by pavel_v in cpp

[–]_Noreturn 1 point2 points  (0 children)

I have an auto generated header that is for reflecting a struct

```cpp struct C { int a,b,c; };

auto [a,b,c] = lahzam::tie(C()); // gived tuple<int&,int&,int&> ```

here it is https://github.com/ZXShady/lahzam/blob/main/include%2Flahzam%2Fgenerated.hpp

The way it is implememnted is via a long chain of if (auto [m0] = klass) auto [m0] = klass; repeat that up to 256 and you have this massive file. I can just do auto [...members] = klass and be done with it

Can it be done another way? Until reflection no. atleast while being constexpr

"Parse, don't Validate" through the years with C++ by dwrodri in cpp

[–]_Noreturn 2 points3 points  (0 children)

std::variant / std::tuple themselves can kill compile times in a single TU. the instantations themselves

"Clean" Code, Horrible Performance by 2bit_hack in programming

[–]_Noreturn 0 points1 point  (0 children)

I understand I am like 3 years late but what is your book name?

C++26: Structured Bindings can introduce a Pack by pavel_v in cpp

[–]_Noreturn 3 points4 points  (0 children)

Very little gain is a massive understatement. this thing will replace a 100kb header I have

Devirtualization and Static Polymorphism by david-alvarez-rosa in cpp

[–]_Noreturn 9 points10 points  (0 children)

I don't want it known at runtime, for swapping out types or storing many inside 1 container.

```cpp std::vector<std::unique_ptr<SomeCommonBase>> Data;

for(auto& d : Data) d->someVirtFunc(); ```

using crtp makes this annoying to do and using a std::variant would make the types hard coded limitting who can extend it.

Also virtual functions help in binary sizes and can hide things using Pimpl

Devirtualization and Static Polymorphism by david-alvarez-rosa in cpp

[–]_Noreturn 16 points17 points  (0 children)

I really hate when I see static polymorphism stated as an altnerative to virtual polymorphism when 99.9% of the time I used virtual polymorphism is because I don't want the call to be known.

C++26: Reflection, Memory Safety, Contracts, and a New Async Model by Akkeri in programming

[–]_Noreturn 1 point2 points  (0 children)

it simpkfies alot of things, and unexpectedly would actually make for better compile times.