[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: X.jpg (54 KB, 1080x1350)
54 KB JPG
They made the fucking C++ gay.
>>
That's the German emoticon ^^
>>
>>109067210
fpbp
>>
File: 1706664852938717.png (82 KB, 380x376)
82 KB PNG
>>109067205
how much dogshit can they possibly heap on this language?
please let C++ die
>>
>>109067210
They made the fucking Germans gay?
>>
>>109067265
always has been
>>
>>109067205
xorring twice does nothing, are they retarded?
>>
>>109067205
I'm just going to go ahead and call it the "double caret operator"
>>
File: no-fun-allowed.jpg (66 KB, 736x656)
66 KB JPG
>>109067255
>>109067299
>>
>>109067318
they should call you the faggot operator the way you handle all those dicks at the same time
>>
>>109067205
a-anon >,,<
>>
>>109067205
it's a psyop to lure the rust people back
>>
File: smile.png (35 KB, 424x373)
35 KB PNG
>>109067323
How did you know?
>>
>>109067205
>COMPILE TIME REFLECTION HEADER
>shipped in C++26 GREEN PILL
>the biggest language change since templates FOOTER TEXT
Can people not just post normally anymore? Why does everything need to be vibeslopped?
>>
>>109067210
As a German I thought everyone used it^^
>>
>>109067205
C++ needs to be dissolved.
>>
>>109067386
We don't do that in Germany.
>>
>>109067205
turn off the stylesheet faggot
>>
>>109067205
why are they working so hard on making C++ uglier? it's already the ugliest language by far.
>>
>>109067612
They don't want to break any legacy stuff even though people compiling legacy stuff are probably still stuck on c++03.
>>
>>109067255
>one of the planet's most used programming languages
>plz let C++ die
we can't all cut off our own cocks and balls just to pretend rust isn't a slow abomination created by imbeciles

>>109067386
>Can people not just post normally anymore?
No. And you'd be surprised by just how many threads the jannies of this board create themselves, only for the board to shit on them every single day.
>>
>>109067210
^^ = schlecht
>>
>>109067205
cant wait to use -std=c99 again
>>
File: 1664326894711.png (143 KB, 382x259)
143 KB PNG
>>109067205
>cat ears
but those are kawaiiii~ eyes
hauuuu I'm taking this function home
>>
File: lain cute.jpg (422 KB, 1000x855)
422 KB JPG
This looks kawaii~ (^.^)
>>
>>109067205
Rust won, by a lot, and it wasn't even close. Persist in your doomed language if you must.
>>
>>109067210
-.-
>>
>>109067210
which is weird since they have to press the key 4 times because it's an accent key
>>
>>109070411
I honesty wish Rust the best, it's doing its job of being a containment language for undesirables.
>>
File: 1773158692756671.jpg (1.36 MB, 2027x3000)
1.36 MB JPG
>>109067766
i'm a C fag, my dick is intact
i hate whenever i have to program C++ after a short break, the language has roughly doubled in size AGAIN
>>
File: neko kiiboodo.gif (220 KB, 320x240)
220 KB GIF
>>109071045
です a modern プローグラミング language should be 大きい. Langlets can't express a plethora of concepts that are necessary in modern ソフトウェア such as generics, coroutines and modules. C++ supports all three (except that module support is still 外人-tier in the year of our 神様 5786). C supports none. It may be 凄い for libraries and embedded, but it's woefully inadequate for big 魚 programs. The 猫の耳 operator will provide a much needed tool for reflection (another cool thing that may prove indispensable in the future), and it will make C++ code look so much more 可愛い~!
>>
>>109067398
>As a German I thought everyone used it^^
nope, I am playing WoW on an english server and when I typed ^^ they didn't know what I mean lol
>>109070421
I don't have to press the key 4 times, it works like every other key on my keyboard, I press it once
>>
>>109071045
When I got back to C++ everyone had re-written the codebase using nothing but lambdas everywhere. Fun to debug.
>>
>>109071045
C++ is a superset of C, so there's no reason for you to use C anymore.
>>
>>109067205
This kind of petty complaining is going to get us a UwU operator out of pure spite.

And i'll hold you responsible for it.
>>
>>109067210
xD ^^
>>
>>109067386
AI is superior.
>>
>>109071470
AI is down. Try again tomorrow!
https://news.ycombinator.com/item?id=48558766
>>
File: 1662489636716845.gif (364 KB, 200x200)
364 KB GIF
>>109071322
>MoDeRn そフとウェあ
i guess OSes aren't 大魚 enough...
>>
>>109071392
that's just async programming for you. it's really cancerous in C++, even with coroutines.
>>
>>109067205
so whats it do
>>
>look up "c++ ^^"
>results for "c++" because google strips ears
>look up "c++ new operator"
>results for "operator new[]" because of course new is an operator
I want to punch someone but not sure who
>>
>>109071657
just make an ai search it for you bro
>>
>>109071657
Maybe search for "C++ cat ears operator" like it says in the picture and consider getting off HRT now that you've seen it rot your brain.
>>
>>109071657
It's called cat ears operator, anon. Stop resisting.
>>
File: 1753587989491.jpg (34 KB, 335x597)
34 KB JPG
>>109071677
You'll also find relevant stuff like this.
>>
>spaceship operator
>cat ears operator
one simply can't dream up a better language
>>
Test
>>
test
>>
>>109071447
This instantly creates a dereferenced dangling pointer and tells the compiler about it so that it knows what all pointers should look like.
>>
>>109067205
FFS this isn't even C++ anymore, it's a completely different language that also happens to support normal C++ as a subset.
Just name it something else already so I can stop pretending to care about these trooned up extensions.
>>
>>109071761
++C++
>>
>>109071761
just learn the new stuff and get with the times gramps
>>
C^^
>>
File: 1752210773068106.png (279 KB, 460x460)
279 KB PNG
Usecase?
>>
>>109071766
--++**CC**++--
>>
>>109071322
シニアアイドルは大好き!黒宮れいちゃんが一番好きです。
>>
File: yog.jpg (120 KB, 704x1134)
120 KB JPG
>>109067255
this ride never ends(hint: c++ is a eldritch fractal language of yog-sothoth)
>>
>>109067205
As usual the C++ committee did reflection in the dumbest, ugliest possible way.
>>
File: Untsdfsdfditled.png (220 KB, 2732x1537)
220 KB PNG
>>109067205
what in tarnation is a reflection?
>>
>>109071950
>what in tarnation is a reflection?
i think that is something impossible to comprehend for vampires and jews
>>
I can imagine a mirror and rotate it in my mind, full color. My brain can do ray tracing, get on my level. You're all dump
>>
>>109071950
https://en.wikipedia.org/wiki/Reflective_programming
>>
>>109071984
this one really didnt help, wiki articles on math and programming are extra shitty
>>
>>109067205
Since when did they add reflection to cpp ?
>>
File: smug.jpg (347 KB, 820x1078)
347 KB JPG
>>109071639
The only one that is and is still written in C is Linux, and with it getting Rust'd, it won't be the case forever.
>>
File: 1764600827559572.jpg (6 KB, 180x171)
6 KB JPG
based C++GODS getting even more features, i cant wait for C++26 especially with the matrix mathematics std library
>>
>>109072133
I want contracts. Pre and post conditions documented in code inside a header are nice.
>>
>>109072133
>matrix mathematics std library
just use Eigen. no need to add all that bloat to std.
>>
>>109072059
C++26. it's fresh out of the oven.
>>
>>109067205
How do you apply for a seat at a C++ comittee?becasue from these shitty missfeatures seems like anyone can do it.
>>
>>109072178
ive been using eigen but the error codes can be pretty hard to decode sometimes and the lack of constexpr support is annoying
>>
File: Boomer.png (83 KB, 550x550)
83 KB PNG
>>109067205
Anon, that is some experimental shit that doesn't even work.
My good old MACROS work, I don't need that gay shit.
>>
>>109071035
It will be forsaken soon. It had enough time to actually become something, but it did not. Time is almost up.
>>
>>109071406
Different languages, C syntax is not compatible with C++, it will literally not compile as C++, unless you're lucky.
>>
>>109071950
It's some functional gay shit again, nobody is going to use it anyways, don't worry.
>>
>reflection is about knowing the program's structure at runtime
>introducing compile-time reflection
Useless dogshit incoming!.
>>
File: 1777022030656212.mp4 (41 KB, 476x476)
41 KB
41 KB MP4
So how does c++26 reflection compare to rust's proc macros or whatever it is that makes print!() work?
>inb4 delusional personal projections
>>
>hey guiz I'm a nocoder but how does peepee compares to poopoo
>>
>>109071425
Nah, but I do see >=< coming
>>
>>109071657
Searrching for anything involving template templates is a fucking nightmare because 99% of the time you just get shit for templates
>>
>>109072015
>>109071950
Type information as data. Information like how many variants are there in an enum, what are they called, what is the size of the underlying type, or what are the fields of a struct.
>>
>>109067205
hot
>>
>>109067205
That’s it, i’m sticking to C and Rust.
>>
>>109070421
you only press it twice since you can't accent the ^ character. so two clicks gives ^^
>>
>>109072662
>you can't accent the ^ character
inb4 unicode turbofaggotry
>>
>>109072554
perhaps an indication that what you're about to do is not just retarded, but very retarded
>>
>>109071657
google c++ "^^"
but i think it's fake
>>
>>109072348
I don't know man, if it can *really* modify behaviors and structures at runtime then i guess that's pretty rad.

Haven't looked into it much yet desu.
>>
>>109072540
You need to seek help.
>>
File: 1438820602371.png (444 KB, 670x461)
444 KB PNG
>>109071657
>results for "operator new[]" because of course new is an operator
>>
>>109072688
A superset of retarded?
>>
>>109071945
boomers just have no taste
they need to go
>>
File: 16480188172010.jpg (103 KB, 907x845)
103 KB JPG
>>109072506
rust will also get reflection. soon(tm)

after all rust is just a cpp distro for zoomers
>>
File: 3003409049140403.png (182 KB, 914x409)
182 KB PNG
>>109071945
>>109067205
what THE FUCK does ^^ even return? i can't find an example anywhere. they just talk about the feature without ever actually specifying what it does.
>>
>>109073109
You offering or…?
>>
>>109073375
decltype(^^::)

I wish I was joking. That's literally the definition in <meta>

Just wait until you see the eldritch monstrosity that is
> consteval template for( std::define_static_array( ... ) )
where you can unreflect of your meta info like so
> [: (^^T) :]

I mean, it did save me several hours when I used it, but you can kiss your compile times goodbye, too, even if you don't include <meta> (it's a gcc -fExtension thing right now)
>>
>>109067205
:3.Contract("I wish that thread 3 will be split between cores 4 and 8 with maximum efficiency");
>>
>>109067255
>how much dogshit can they possibly heap on this language?
All of it.
>>
>>109073100
it's reflective at compile time
>>
unrelated but new disney movie has cute sexy cunny design
>>
File: 1750189720581672.jpg (60 KB, 850x400)
60 KB JPG
its like they forgot the very basics
>>
File: 1619586752915.jpg (294 KB, 1280x720)
294 KB JPG
This is fake right? It's a joke?
>>
>>109071657
>results for "operator new[]" because of course new is an operator
An people bitched about Pascal, this industry is an ass backwards satire.
>>
File: 1779738643736562.jpg (85 KB, 711x994)
85 KB JPG
>>109073640
but WHAT THE FUCK DOES IT RETURN? same malarkey as cpp errors?

how is there no clear documentation of what the fucking thing is supposed to print. i hate cpp.
>>
>>109073810
reflection is useful thought, and will be useful in rust. cpp is just dogshit for having so much legacy code to be compatible with. they should've added hrd syntax deprecation like rust editions. and good docs. this is why we use rust.
>>
>>109074170
I'm probably doing this wrong desu, but I think of it as a "compile-time pointer-to-a-token" (token being a type, variable, another operator itself-- it's just how the compiler sees your code in raw form)
reflection's ^^ returns a "pointer" (like '&') to the compiler's token representation, and unreflection's [: info_obj :] "dereferences" it (like '*'), inserting the pointed-to token into the compile-time token stream.

Of course, you also have a lot of consteval functions in std::meta that can unreflect/"dereference" the std::meta::info/"token pointer" object internally and return normal values at consteval-time. You can look at (most of?) em in the <meta> header itself, all they really do is (is_base_of_type, for example)
return std::is_base_of_v< [:base_info_obj:] , [:derived_info_obj:] >;

that is, deref the "token pointers", evaluate the template with em filled in, then return the result like a normal consteval function
>>
>>109067205
What does it do?
>>
>>109067399
You just hate white people.
>>
>>109073640
Is reflection another one of those braindead features that does not work without the standard library? C++ headers are hard banned in my code, so I can only use things which work without c++ headers.
>>
>>109074280
Is just another retarded feature like coroutines and ranges that only increase compilation times without providing any benefit that can't be obtained in better ways.
>>
>>109071406
My new bloated javascript webpage is a superset of my old simple static html website so there's no reason for you to use it anymore
>>
>>109074308
You mean the standard library, right?
Surely you use headers, even if (old?) C++ breaks the design pattern of separating declarations and definitions for some fucking reason
>>
>>109067255
We can't its too usefulnt
>>
>>109074308
Nope, the only "wtf is this shit" moment I had was the
using info = decltype(^^::);
You can throw that in your own code tho, and everything else follows from being able to use+fuck with "token pointers" at compile time. Most of those consteval query functions (in std::meta) just "unreflect" their args into templates and return/reflect the result in turn.

I dunno about your situation, but if you're in embedded, usually type_traits and purely compile-time stuff like string_view or spans are OK as long as you don't pull in runtime/linking symbols.

>>109074348
Brevity and not having to maintain boilerplate. It's really helpful if you're a small team, imo, but the compilation time increase is a real complaint.
>>
>>109074170
It returns an "opaque data type".
>>109074308
Without the standard library it can only tell you if a language construct (like a type) is the same as another language construct. In practice that saves you from including <type_traits>.
>>
Yeeeaaah I'm just going to keep writing C++11, sorry Bjarne.
>>
>>109072340
That's why you should be using C++ not C.
>>
File: 1779639504522304.png (121 KB, 527x622)
121 KB PNG
>>109074534
so you're saying you can't do the current thing? ok we'll call you. next!
>>
>>109067255
>>109071940
at this point we should keep C++ going out of pure spite, to see what it can end up looking like in 50, 100, 500 years of cludging new bloat features onto what was at some point in the distant past just an extension of C
>>
>>109072261
do you assign expressions to auto variables? because changing to an explicit declaration is often all it takes to go from cryptic nonsense to THE COMPILER YELLING AT YOU IN ALL CAPS TELLING YOU EXACTLY WHAT YOU FUCKED UP
>>
>>109071406
simplicity and lower technical debt
>>
>>109074620
C++ can’t into anonymous designated initializers

typedef struct {
bool fuck_c_plus_plus;
} Bar;

void foo(Bar* bar);

int main() {
foo(&(Bar){ .fuck_c_plus_plus = true });
return 0;
}
>>
>>109075025
use case? if it's got a lifetime beyond the function call you can just initialize it on a separate line.
>>
>>109075075
it's zero initialized by default so it is extremely ergonomic if you treat zeroed memory as valid state. with a simple macro trick it also gives C default arguments. because it's a pointer you can also nest it into deeper function calls without worrying about needlessly copying memory

typedef struct {
bool do_something;
int some_value;
const char* filename;
unsigned line;
} foo_opt;

#define foo(needed_value, ...) foo_((needed_value), &(foo_opt){ .some_value = 3, .filename = __FILE__, .line = __LINE__, __VA_ARGS__})
void foo_(int needed_value, foo_opt* options) {
return;
}

int main() {
foo(6, .some_value = 7);
foo(23, .filename = "bar", .do_something = true);
return 0;
}
>>
>>109075207
>you can also nest it into deeper function calls without worrying about needlessly copying memory
im a dummy, you can always just get a pointer to it before passing it on. other points still stand tho
>>
>>109075207
in C++ you just get default arguments.
>>
>>109075285
Sure, but C++ didn't get designated initializers until very recently and I use them all the time regardless. I want to write code that depends on tooling so simple a schizophrenic nerd can write the program necessary to compile it in a couple of months from his basement.

I want to be able to us any piece of shit compiler from any platform or environment from almost 30 years ago and still have my code compile with minimal issue.
>>
>>109073375
>i can't find an example anywhere
have you tried google? this thing is rad fr fr
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2996r0.html
>>
>>109075378
>R0
Anon... It's R13 now
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2996r13.html
>>
>>109074866
updooting the behavior of auto is perhaps the most retarded thing i've ever seen adopted in C++
it's like the reverse of every single dynamically typed language realizing "oops! maybe types were a good idea after all" and tacking on a half-assed and ineffectual type system, except in this case it's some sort of C mutant lusting after getting rid of one of its greatest strengths
>>
>>109074866
For compiler, it doesn't matter if it's auto or explicit (assuming there's no type conversions or cv-qualifiers dropping). Working language server can tell you the type of auto on hover.
>>
>>109071657
nigger just search c++26 reflection operator
>>
File: 1698620153447405.png (23 KB, 412x443)
23 KB PNG
>>109075532
>he needs an ide to reason about his code
>>
>>109075543
>missing the point
retard
>>
>>109074176
>this is why we use rust
Nobody cares why u use rust. You won't use it for long, as it has lost momentum and will not become the replacement for a real lang like c/c++.
In that regard it is worse than python and js, because even those abominations are there to stay. Rust is not. It's as good as dead, just wait and see. It has no corpos behind (oracle and microslop) to keep it alive. Neither does it have any relevant software that depends on it, so COBOL has chances to outlive rust.
Let that sink in.
>>
>>109072274
>Anon, that is some experimental shit that doesn't even work.
>My good old MACROS work, I don't need that gay shit.
This. None of my compilers, nor the compilers on compiler explorer, could even tell me the name of a type. I could rant about the worthless faggots pushing this. They all write incompetent code, and the LLVM devs that put up with them, they haven't tested their experimental toy beyond fetching scuffed pointer to member iteration.
>>
>>109067267
This, the romans tried to de-gay them.
>>
>>109074176
>this is why we use rust

Rust is starting to look like all those other langs that were going to replace everything and then didn't and then were forgotten about.
>>
>>109075696
>None of my compilers, nor the compilers on compiler explorer, could even tell me the name of a type.

What's even the point then? Legit question, not trying to rag on it.
>>
>>109072348
It has literally nothing to do with functional programming retard.
>>109071945
Surely you have a better idea that you'd be willing to share then, let's see what your great mind has come up with.
>>
>>109075511
>updooting the behavior of auto
What update? It's the same as it has been.
>the reverse of every single dynamically typed language
You're a retarded nigger.
"auto" doesn't get rid of the types. It isnt the equivalent of dynamic typing at all, in fact it actually gives you STRONGER guarantees that there are no implicit type conversions occurring anywhere. The value contained in the "auto" variable is EXACTLY the type that you assigned to it, and it can't accidentally be declared uninitialized.

auto f = YourType{}; // you can also just do this if you want to read the typename on the same line. 
>>
>>109077803
Last time i checked "auto" just invokes type deduction and you can look up its 'rules'.

Why are we treating it like some mysterious type behavior???
>>
>>109067210
\o
>>
>>109067334
the best rustaceans went straight from c to rust, because seepeepee was always retarded.
>>
>>109067399
>we unanimously decided to stop cashing our bureaucracy checks --committee members
should happen any day lol
>>
>>109067612
bjarne and his posse don't actually code. so, they are not negatively affected by it.
no compiler supports the full standard anyway, so literally no one is, or can, use all the new features.
>>
>>109070411
who are you directing this at?
none of the /g/eets here actually code.
>>
>>109072321
>two more weeks until rust is fully forgotten
>>
>>109067210
^w^
>>
>>109071950
tard committee's supposed answer to rust's proc macros.
it will prove to be as workable, useful, and widely adopted, as bjarne's "safety profiles".
>>
>>109078427
Not two more weeks, but it's definitely been put on the same rails as all the other meme langs.
>>
>>109072506
the "theory" is that it will be used for things rust procs macros are used for (e.g. serialization/deserialisation).
reality: while theoretically enticing, it's the wrong solution for many problems. it's a c++ "design" (read: safe to assume it's spectacularly retarded is some aspects). and it needs to interact/integrate with the other 1536476777 language features. not to mention the lack of an actual integrated C++ library/package ecosystem. and the fact that almost no one will use the feature (if it even gets fully implemented). all this means it will be DOA, just like a thousand other "omg finally" seepeepee "features".
>>
>>109073363
nice try C/C++ committee faggot nigger, whose name i don't even remember.
if rust ends up getting reflection, it will be sensibly limited and tried out for years *in practice*, before any final decisions.
>>
>>109078486
can you share more stories from your happy place?
sounds entertaining.
>>
>>109078561
so you're saying they will add it to rust standard after it gets tried? oh wait I forgot, rust doesn't have a standard specification lmao
>>
File: 1688315420538675.jpg (49 KB, 1078x1078)
49 KB JPG
>>109077803
>What update? It's the same as it has been.
"auto" in C and historically in C++ was a virtually unused storage class specifier keyword used to declare a variable as having local storage. since this is the default, it's not used in practice and is part of the language more for completeness than anything else.
C++ committee thought that since it's not used, they could redefine it, which they did, so now in C++ it deduces type or whatever the fuck it does
>>
>>109067210
>>109070418
. _.
>>
>>109075025
the problem here isn't the designated initialiser but the compound literal, THOUGH
>>
>>109078690
Bro that change was 15 years ago with C++11. I thought you meant a new change with C++26.
>>
>>109078617
standards are meaningless when they're garbage. module status? oh right, shut the fuck up.
>>
>>109078617
>I'M TOP ENGINEER SAAR. HERE ARE THE DOCUMENTS AND CERTIFICATES TO PROVE IT.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.