|
eschaton posted:truly truly truly outrageous
|
# ¿ Jul 23, 2018 14:07 |
|
|
# ¿ May 11, 2024 00:48 |
|
gonadic io posted:ty for this. is there an equivalent in c++ or is it just a bunch of types that are like "lol i've got an internal pointer to myself and you moved me time for ub" short answer: no long answer: moves in c++ aren't destructive, so moving an object into another one requires the moved-from object be in a "valid but unspecified state". This typically means that the object will be in its default constructed state (e.g., std::unique_ptr and friends), but for small builtin types that aren't used to modify state in the destructor it's cheaper and faster to not move them or reset their value. If performing an operation on an object would cause UB (for instance, dereferencing a std::unique_ptr), that operation is not protected against, but is antithetical to the idea that you're working with a different object, as the original one was moved elsewhere. as for rvalue references in general, they're basically a special tag in the type system. I can technically move a value into a function that is then moved into a function (repeat several times) but as long as I don't move said rvalue reference into another object (either via construction or return), its lifetime is unaffected and its scope doesn't change. That said, when an rvalue reference is moved into a function, you need to then explicitly move it once more as it has become an xvalue which has the lvalue property of identity (its named or how else would you interact with it), but also has the prvalue property of safely moving from. basically this isn't a property of c++, though there are some that wish we could have destructive moves, but that would break a shitload of code as existing code would for the most part continue to compile correctly, but destructors would be secretly reordered and that could cause a huge headache for people that depend on our existing operations. That said, there's a concept being put forth now of relocation which will be the closest thing c++ might get to destructive moves Also just nipping this in the bud, but c++ value categories are kind of a mess to understand in full legalese so i might have gotten the specifics of lvalue vs glvalue wrong for the second paragraph
|
# ¿ Jul 28, 2018 13:00 |
|
Luigi Thirty posted:typedef std::vector<Window *>::iterator WindowIterator; I'm having flashbacks to 2013 when I was in gamedev and working 100+ hours a week with gcc 4.2 because the toolchain we were targeting didn't support clang. eschaton posted:lol at Stepanov's terrible library design, having everything take begin and end iterators instead of having sensible collection protocols Don't forget output iterators with no known end, because having them act as streams with a concept of exhaustion might be bad or something. iterators as cursors vs iterators as streams was such a colossal fuckup for c++
|
# ¿ Aug 5, 2018 16:26 |
|
TheFluff posted:this miserable pile of angle brackets and colons allegedly wraps a c function that uses setjmp/longjmp for error handling (lol libjpeg) such that it throws c++ exceptions instead and im not sure if it’s terrible or awesome This is actually pretty neat. setjmp/longjmp error handling in stuff like lua means you need to compile these C libraries as C++ just so destructors run and that's a nightmare. That said, this code is deffo c++11/c++14. result_of_t was deprecated in c++17 and removed for c++20. A more "modern" code example would look like this. i probably hosed up the perfect forwarding for returning a value but who cares you get the idea
|
# ¿ Aug 16, 2018 14:24 |
|
prisoner of waffles posted:I understand what it is supposed to do (turning C-style "exception handling" into C++-style) tbqh the idea of converting setjmp/longjmp to a c++ exception entirely within c++ without using ABI specific info is an insane idea and I never would have thought it was possible
|
# ¿ Aug 16, 2018 17:46 |
|
Achmed Jones posted:my c++ is definitely c with classes any of Kate Gregory’s stuff. she’s able to bring you up to speed on stuff quickly. I think it’s all through pluralsight though.
|
# ¿ Aug 17, 2018 06:41 |
|
MALE SHOEGAZE posted:rust has many problems, not being explicit enough just doesn’t seem like one of them rust is cool, but I feel like I’m fighting api decisions more than anything else also rustconf was cool
|
# ¿ Aug 18, 2018 15:05 |
|
tinaun posted:
i sat next to some ex-c++ users and we all talked about build systems because of course we did since i was present im gonna be working with Alex to improve the cmake crate though, and also add meson reading support
|
# ¿ Aug 18, 2018 16:46 |
|
c tp s: i've finally snapped. i've forked gnu m4 and i'm rewriting it in C++17. I already ported the autotools portion over to cmake, and have ported a few files. its gotten to the point where the wget maintainer is following me and asking if i could please make it run faster. once the fork is semi-working im gonna take a stab at all of autotools to see if i can put together some sort of metadata extractor so you can at least get info on an autotools project in json or some bullshit so you dont have to run a configure script. i've spent like 3 days working on this port, and im worried im going to be the youngest person alive with experience regarding the m4 codebase edit: by semi-working i mean it passes all tests on macOS and Linux, and sorta works on windows under msvc
|
# ¿ Aug 24, 2018 07:58 |
|
akadajet posted:why are you doing this, again? stepping stone to see if I can write a tool to extract build info and metadata from an autotools based build. if successful, it’ll help most of the effort in the c and c++ communities when it comes to dependency management
|
# ¿ Aug 24, 2018 15:13 |
|
VikingofRock posted:For what it's worth this RFC just got accepted so rust's Error trait should improve soon™. There's also Boat's Failure crate which is neat. (C++20 is going to have a stack trace API, so error reporting should improve there as well)
|
# ¿ Aug 25, 2018 02:20 |
|
eschaton posted:I know this is supposed to be a safe space and all but i dunno man it’s been fun so far to destroy all the old busted code and get this working on windows Slurps Mad Rips fucked around with this message at 04:01 on Aug 26, 2018 |
# ¿ Aug 26, 2018 03:33 |
|
Luigi Thirty posted:speaking of things that are busted, the entire STL in VC6 yeah thats dinkumware for you. MS doesn’t contract with them anymore. it’s also why lots of gamedevs wrote their own stdlib stuff for the next decade or so if you need an STL for that time period I recommend you look into STLPort. there’s deffo a version that supports vc6 somewhere on sourceforge. also maybe grab the last version of boost to support vc6 so you can get decent string/vector implementations
|
# ¿ Aug 26, 2018 04:01 |
|
pointsofdata posted:im gonna fake my own death, move to Nice? edit: the city
|
# ¿ Aug 29, 2018 16:05 |
|
DONT THREAD ON ME posted:how should I do exception handling? I'm most comfortable with Either's and saw someone recommend using them but no idea if that's a good idea or not. I'd rather learn to do what actual real programmers programming C++ do which I'm guessing is exceptions. you can do both! The best part is you can move between the two and your choice won't be wrong as long as you don't treat the non-exception error-handling like a C programmer who went into a coma in the 80s and woke up yesterday. One thing you'll run into is "How do I construct an object and make sure it never throws?" since you're coming from Rust you just do what Rust does. Static member function, returns an either (we call ours expected, but there's also outcome and that one is a bit better refined). Want to quickly wrap a function that *might* throw and have it turn into an expected? You get to use one of the least well known features of C++: using try blocks as function bodies C++ code:
tbqh he community is extremely split between people who say "no, exceptions are terrible for high performance code and here's a bunch of proof and examples", people like Herb Sutter who think there's something we can do to bridge the gap (but misunderstanding error handling approaches from other languages) and then people like Bjarne who say "software engineers should write software and leave language design to designers such as myself". (remember, the vasa sank because jet fuel can't melt wooden beams) if anything though, c++ has some decent capabilities for bridging schools of thought. private inheritance gets you mixins and composable interfaces. public inheritance gives you (in the case of a virtual destructor) class 90s OOP. protected inheritance gives you a bridge to go from public hierarchies to a private hierarchy while keeping both interfaces satisfied. (protected inheritance is "i know that myself is-a Base, but to everyone else I look like has-a Base interface")
|
# ¿ Sep 2, 2018 09:16 |
|
DONT THREAD ON ME posted:the reason the borrowchecker is failing is because it is illegal to move out of borrowed content in rust. it's one of the rules of the language. it's not aware of why it's bad. so yeah, it's absolutely opaque. i agree. the same relationship between Arc and Box in rust. except we don’t have an Rc, though my retain_ptr paper might pave the way for one eventually. eschaton posted:why did Rust go with its memory model instead of something like ARC where the semantics are a bit less opaque? with retain_ptr I can do whatever I want with ObjC's ARC bullshit and I can just let implicit copies happen whenever. i bow before no mortal Slurps Mad Rips fucked around with this message at 06:09 on Sep 3, 2018 |
# ¿ Sep 3, 2018 06:00 |
|
Luigi Thirty posted:smart pointers? lambdas? sorry can’t hear you VC6 barely has the ++ part down tbqh it’s more or less on par with gcc 2.95 which was its main competition when they were released i need to go find that patch someone did to the half life 1 sdk so you could make mods with gcc 2.95
|
# ¿ Sep 3, 2018 08:23 |
|
prisoner of waffles posted:In the case where there are no fields and all methods are pure virtual, yeah, that's quite similar to Java's/C#'s/Go's/ God knows how many other languages' interface concept sort of. you can still write an implementation for a pure virtual function and the compiler will not complain (nor will the linker)
|
# ¿ Sep 6, 2018 22:36 |
|
Luigi Thirty posted:knowing what's in my vectors would be nice also, for future reference, when working with base classes, you can use dynamic_cast and the if assign approach to enter specific type blocks (as long as you know all the types or don't care about anything but one or two) Something like this if you're stuck with msvc 6 C++ code:
|
# ¿ Sep 7, 2018 22:15 |
|
is it really too hard to use manager/worker, or does that phrasing hit too close to home with how little control we have over our jobs sometimes?
|
# ¿ Sep 13, 2018 14:05 |
|
brand engager posted:People care about what that dude thinks about anything? yes unfortunately Symbolic Butt posted:I'm the voice he does here: im the part where he unironically says "Like a lot of new programming languages are made by people who just are making small stylistic changes..." without any self awareness whatsoever
|
# ¿ Sep 14, 2018 17:20 |
|
Symbolic Butt posted:his thesis is something like "she unwittingly wrote an arena-style memory allocator to fool the borrow checker" which seems to be the usual way to go in games written in C++ anyway. lol but she didn't. jblow has this terrible affliction where he opens his mouth sticks his foot into it and then blames feminism for why he's getting dunked on for his dumb as hell views. please think of this rational, clearly thick skinned, reasonable man's feelings also, just fuckin' lol at an hour long response to a 5 minute portion of a 45 minutes video he didn't watch all the way through (also, rust doesn't permit per-container allocators yet, so no, she did not write an arena allocator. she wrote an ecs in rust where she doesnt have to worry about an invalid entity bringing the entire system to its knees)
|
# ¿ Sep 14, 2018 20:22 |
|
DONT THREAD ON ME posted:does jblow have fans within the game industry or is his club made out of gamers and aspiring game devs? from my experience its mostly gamers and people looking to break into the industry. on more than one occasion, quite a few people have described him as "someone who has never suffered a day in his entire life", while others say he acts like someone who "wears a hat that says I'm special on it"
|
# ¿ Sep 14, 2018 22:46 |
|
Shaggar posted:I use it when I need to SSH into legacy systems, but beyond that its pointless. lmao openssh has been shipping natively with Windows 10 for months now what the gently caress are you even doing aside from loving up
|
# ¿ Sep 26, 2018 03:40 |
|
CRIP EATIN BREAD posted:windows is a fine OS if you are chronically poor or incapable of using a computer that's connected to the internet. it works well if you treat it like a video game console, its a toy for novel purposes, and the people who spend the majority of using it are pathetic and useless. eat whats left of my dick
|
# ¿ Sep 26, 2018 06:46 |
|
mystes posted:Guess what everyone, Microsoft has a present for you! Not to be outdone by the .net faction's .net core the C++/COM faction has I-loving-poo poo-you-not decided to make what essentially appears to be "COM .net" (which can of course run on Linux) for some inexplicable reason. Kenny is an absolute madman to begin with so I’m shocked that i didn’t hear about this in some capacity at CppCon, but I’m not surprised he’s involved
|
# ¿ Oct 11, 2018 12:23 |
|
Kevin Mitnick P.E. posted:c++ is supposed to get modules eventually but millenials killed it. at least i assume we have succeeded by now cause that post is from a year ago. sorry I'm in the process of updating the style of my site which is why I haven't posted an update on where we are as of san diego, and nothing else has been posted there since the millenials post. We're getting "merged modules", which are a combination of the modules TS and the ATOM proposal. If we can get P1302 added to an appendix in some way, it might even be fun to write modularized c++
|
# ¿ Dec 21, 2018 08:19 |
|
elite_garbage_man posted:Not too loud “look in video game development we don’t have time for unit tests. if it looks like it works then it works”, my manager said as he hit “run” in visual studio 2010 and then refused to make eye contact with me as it immediately crashed from a pure virtual function exception.
|
# ¿ Jan 18, 2019 22:04 |
|
c tp s: I'm trying to (desperately) make sure I never have to touch CMake again (this is a lie, but if it means I have to touch it less often then its worth it) by writing a library that does the common operations everyone does in CMake automatically. Even a few of the maintainers are keeping an eye on it. This means I've been deep into CMake and know it to a degree that the average mere mortal is nowhere near understanding. So here's a
How am I getting this loving shitshow of a library out to people? They put a FetchContent call at the top of their build file and watch the fireworks. You'll only ever use like 5, maybe 6, commands unless you're doing some wacky poo poo like generating an ar script as a hack or whatever. I loving hate cmake
|
# ¿ Feb 1, 2019 06:12 |
|
Xarn posted:Ahahahahahahahahahahahahahahahaha Also make sure to read the notes from our recent telecon because we’re finally loving doing stuff. we have another telecon next week. luckily, a few people are listening to me now that they’ve seen it with their own eyes despite me raising hell over this since October of 2017. apparently some people thought I was being alarmist and then recently realized I wasn’t the one good thing that came out of that telecon was getting the author of the Modules TS to agree that compiler devs aren’t putting enough effort into their frontends. fingers crossed we can get something into C++20 but I’ll know more in a few weeks after Kona happens.
|
# ¿ Feb 2, 2019 08:43 |
|
ratbert90 posted:I used to use CMake, but then I switched to Meson. the author of meson is cool and chill and i like the new logo. the recently added support for cmake in meson is pretty good too. the only reason im doing all this work is that there is some stuff i need meson to do that it cant right now. i think im also waiting on the wrapdb support to allow naming local directories also i wish i could just dump a json/yaml/toml/whatever the gently caress file into meson for basic key-value pair definitions but oh well once im done with this cmake project i can start working on my 'modern' build system in earnest again
|
# ¿ Feb 2, 2019 20:49 |
|
Oneiros posted:power move https://gitmoji.carloscuesta.me/
|
# ¿ Feb 10, 2019 14:07 |
|
|
# ¿ May 11, 2024 00:48 |
|
eschaton posted:you do so much cool poo poo with each one though seriously, I wish I had half the motivation she does to work on stuff. instead I’m over here writing cmake so no one else has to suffer
|
# ¿ Apr 14, 2019 20:10 |