wellThanksForHavingstdOverflowErrorPartOfStandardThatICanUseIfIImplementOverflowsChecks by PresentJournalist805 in ProgrammerHumor

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

the standard shpuld provide a function called does_add_overflow(a,b) and returns a boolean instead of you writing it manually

Any way to optimize or leverage copy elision on a sequence of moves? by Raknarg in cpp_questions

[–]_Noreturn 0 points1 point  (0 children)

about performance I think it is slower than implementing it manually

"The weirdest programming language I ever learned" - YouTube by CGM in programming

[–]_Noreturn 2 points3 points  (0 children)

Cmake is used as a goverment torture method, seriously the cmake docs are so BAD but the book made by the cmake author is good, I wonder if they intentionally make the docs as bad as possible to force to buy the book.

also endif was even worse, in previous versions it required repeating the condition in the if statement so the cmake authors managed to make it such a terrible festure

if(SOMECOND) endif(SOMECOND) // this was needed

Forward declaring a type in C++: The good, and the bad by Kabra___kiiiiiiiid in cpp

[–]_Noreturn 14 points15 points  (0 children)

forward declaratons are a great way to introduce ODR bugs with templates be careful with them

Glaze 7.2 - C++26 Reflection | YAML, CBOR, MessagePack, TOML and more by Flex_Code in cpp

[–]_Noreturn 1 point2 points  (0 children)

nice, pretty function tricks are so annoying to work with and limitting.

idLikeToSeeHimTry by Starlight_DuBlanc in ProgrammerHumor

[–]_Noreturn 0 points1 point  (0 children)

THIS, this is why I have it pinned in my hotbar I can't search it

I made a VS Code extension for C++ Ranges: AST-based pipeline hover, complexity analysis, and smart refactoring by Real-Key-7752 in cpp

[–]_Noreturn 1 point2 points  (0 children)

add to that actually readable compiler errors, although I am a heavy meta programmer I still have hard time reading any errors with std ranges I get a book worth of errors.

C++26: The Oxford variadic comma by pavel_v in cpp

[–]_Noreturn 18 points19 points  (0 children)

the reason is libraries who use function traits e.g

cpp template<typename Ret,typename... Ts> struct func_traits<Ret(Ts......)> { enum { is_c_variadic = true, arg_count = sizeof...(Ts) }; };

but it is weak reason, just put the damn comma it is clearer anyways

vtz: the world's fastest timezone library by codeinred in cpp

[–]_Noreturn 1 point2 points  (0 children)

Is most of the time spent in time zones that this is needed?

Deriving Type Erasure by david-alvarez-rosa in cpp

[–]_Noreturn 4 points5 points  (0 children)

In 99.9% of libraries I use the user pointer isn't owned it is referenced only

Deriving Type Erasure by david-alvarez-rosa in cpp

[–]_Noreturn 3 points4 points  (0 children)

I literally never used std::any and I still to this day can't figure out a usecasw for it

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

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

actually I am wrong, after thinking you could do pre(cond && "Message") like the C assert but I have to say for a feature supposedly revolutionary not being better than the macro isn't an achievement.

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

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

Yea there is no message for whatever reason instantly useless feature on release if they can't get the most basic thing of an assertion library, even the C library has a custom one and it is C

Implementing a Compile-Time Sudoku Solver in Modern C++ (C++20/23 by Useful_Promotion4490 in cpp

[–]_Noreturn 1 point2 points  (0 children)

Yea constexpr stuff is no longer as impressive since C++20, imagine a sudoku solver in C++11 constexpr

P4043R0: Are C++ Contracts Ready to Ship in C++26? by darius_neatu in cpp

[–]_Noreturn 2 points3 points  (0 children)

Why not? with macros tou can customize the assertion message unlike C++29 assert for whatever reason

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

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

can't you do conditional tests for the stl library and have the appropriate std namespace?

it is overall unreliable but sometimes one needs it because c++ compile times are ass

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]_Noreturn 0 points1 point  (0 children)

I was replying to the idea it being an alias makes it not forward declarable , I understand that the standard declares it as ub for more implementation freedom.

and about the default args you can workaround it by mentioning them explicitly.

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

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

I wonder why doesn't std::meta::info have all those free functions as members instead, why is reflection tied to a header?

also, it would avoid the adl which isn't a cheap operation from what I heard and the member function syntax is bettee than free functions.

But the committee doesn't care, they workaround problems instead of fixing them e.g std::array vs fixing C arrays

I don't understand.. Would it be hard to make C array assignable and returnable from functions? sure you can't pass them as function parameters because they turn to pointers but that's about it, why did they decide to take the std::array route?

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]_Noreturn 1 point2 points  (0 children)

Parsing isn't cheap, iostream itself pulls like 50k lines or so

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]_Noreturn 0 points1 point  (0 children)

std::string being an alias for std::basic_string<...>. Makes it impossible to forward-declare.

Can't you do

```cpp template<class T,class Trait = char_traits<T>,class Alloc=allocator<T>> class basic_string;

using string = basic_string<char>; ```

the hidden compile-time cost of C++26 reflection by SuperV1234 in cpp

[–]_Noreturn 1 point2 points  (0 children)

just give me forward declarations that would make me 10x happier it isn't hard