|
one wonders what hackbunny actually does. i picture some standard banal coding task, from which he keeps getting distrated going "oooh, where does *this* pointer go?!"
|
# ? Oct 19, 2016 18:33 |
|
|
# ? May 18, 2024 02:49 |
|
rjmccall posted:their member function pointer representation is so much more complicated than you're giving it credit for well they try their hardest to always return a flat function pointer, if at all possible #justclthings rjmccall posted:i didn't know that they'd changed it to not thunk virtual functions, though caught me, I didn't check actually, but I assume they do now that they've switched to a single layout for all cases of member function pointer rjmccall posted:also not sure what you think the problem is with that I want the goddamn method implementation pointer is my problem with that. I know it's completely non portable but you'd think there was a compiler-specific way to do it. but no, no way to get the implementation pointer, or a pointer to the vtable, or a vtable slot index. none at all. void **pvtbl; memcpy(&pvtbl, object, sizeof(pvtbl); like a animal
|
# ? Oct 19, 2016 18:46 |
|
those aren't the semantics of member function pointers. they have to dispatch. the implementation pointer can only even theoretically be recovered when the object is known, which it isn't
|
# ? Oct 19, 2016 19:01 |
|
hackbunny posted:well they try their hardest to always return a flat function pointer, if at all possible #justclthings that almost certainly has nothing to do with virtual functions and everything to do with all the other representational complexity due to virtual/multiple inheritance, which msvc has historically been non-compliant about if they've picked a single representation it's probably the four-pointer form, tho maybe they decided to bail on virtual-base conversions since they ended up not actually being legal under the standard
|
# ? Oct 19, 2016 19:06 |
|
rjmccall posted:those aren't the semantics of member function pointers. they have to dispatch. the implementation pointer can only even theoretically be recovered when the object is known, which it isn't but I have the object! (where would I memcpy the vtable pointer from otherwise?) borland c++ had a proprietary operator to take a bound member function pointer, but visual c++ doesn't. still now I wonder what the borland operator actually returned member function pointers give me a big headache and I don't have a mental model of them Cybernetic Vermin posted:one wonders what hackbunny actually does. i picture some standard banal coding task, from which he keeps getting distrated going "oooh, where does *this* pointer go?!" lol you aren't even wrong. but right now I'm doing re so I need to gently caress with abis and the like
|
# ? Oct 19, 2016 19:15 |
|
hackbunny posted:but I have the object! (where would I memcpy the vtable pointer from otherwise?) borland c++ had a proprietary operator to take a bound member function pointer, but visual c++ doesn't. still now I wonder what the borland operator actually returned sure, you can have a non-standard operator or something. some compilers used to let you partially apply a member function (e.g. obj.foo) and get the implementation back as a function pointer, although that was a quirk of their implementations, usually did not work correctly with multiple inheritance, and has mostly been stamped out (but you might still be able to use some flag to re-enable it, idk) a member pointer is an abstract reference to the member. you take it and an object and can get a concrete reference to a specific member. for a member function, all you can do with that is call it, which you have to do immediately, just like a direct access to the member. but it's specified to have the same behavior as what a direct access would have done
|
# ? Oct 19, 2016 19:31 |
|
my c++ education going well, covered pointers and references, can use smart words like stack and heap now, also memory leaks for everyone
|
# ? Oct 23, 2016 01:31 |
|
std::make_shared
|
# ? Oct 23, 2016 04:22 |
|
that's basically all the c++ I learned
|
# ? Oct 23, 2016 04:22 |
|
that's basically all the c++ I learned
|
# ? Oct 23, 2016 04:22 |
|
cool doublepost didn't know that was even possible
|
# ? Oct 23, 2016 04:23 |
|
Bloody posted:std::make_shared https://twitter.com/isotrumpp/status/704382042327420930
|
# ? Oct 23, 2016 04:28 |
|
Bloody posted:I don't know what a mapper does mybatis is a statement mapper. it maps a method in your code like C# code:
SQL code:
dapper is not as good as mybatis, but it gives you some simplified stuff like being able to call a proc and have the input/output mapped for you from your existing type like C# code:
|
# ? Oct 23, 2016 04:38 |
|
so it's like most of the good parts of an orm without all the orminess
|
# ? Oct 23, 2016 04:48 |
|
Bloody posted:std::make_shared no, make_unique!
|
# ? Oct 23, 2016 12:38 |
|
Bloody posted:that's basically all the c++ I learned not continuing to learn c++ was the best decision you'll ever make this is probably true even if your job involves writing it
|
# ? Oct 23, 2016 12:45 |
|
Pollyzoid posted:some stuff about the insides of windows subsystem for linux https://www.youtube.com/watch?v=_p3RtkwstNk this is cool.
|
# ? Oct 23, 2016 17:13 |
|
Is there some way to make C++ do late binding
|
# ? Oct 24, 2016 00:44 |
|
true late binding — string-based lookup with dynamic type matching and so on — doesn't really play well with a lot of different c++ features. that's not really the direction c++ wants you to take, and my first instinct is to tell you to find a better approach that fits more idiomatically with the tools c++ does give you but if you really wanted to, you could certainly come up with something tolerable using templates and macros (tolerable to use, at least; other people would probably be terrified of touching it)
|
# ? Oct 24, 2016 01:21 |
|
OOP looks like dog poo poo garbage in C++
|
# ? Oct 24, 2016 10:37 |
|
OOP is dog poo poo garbage.
|
# ? Oct 24, 2016 12:03 |
|
Bulgogi Hoagie posted:OOP looks like dog poo poo garbage in C++ you'll be happy to note that Rust has made interop with c++ including c++ oop code a priority for this coming year https://github.com/aturon/rfcs/blob/roadmap-2017/text/0000-roadmap-2017.md posted:The goal should be that using a C++ library in Rust is not much harder than using it in C++. In other words, it should be possible to directly include C++ headers (e.g., include! {myproject.hpp}) and have the extern declarations, glue code, and so forth get generated automatically. This means (eventually) full support for interfacing with C++ code that uses features like templates, overloading, classes and virtual calls, and so forth.
|
# ? Oct 24, 2016 12:17 |
|
gonadic io posted:you'll be happy to note that Rust has made interop with c++ including c++ oop code a priority for this coming year i want this now
|
# ? Oct 24, 2016 13:03 |
|
Is that in general, or just for specific ABI? Because if its the former, wow.
|
# ? Oct 24, 2016 13:31 |
|
rust-spec.md: #include "c++-spec.nightmares" i'm sure this will turn out just fine
|
# ? Oct 24, 2016 13:40 |
|
why not just rename it c++/-- at this point?
|
# ? Oct 24, 2016 14:05 |
|
Sapozhnik posted:rust-spec.md: #include "c++-spec.nightmares" i'm hoping they can delegate the real parsing work to gcc or clang
|
# ? Oct 24, 2016 14:09 |
|
gonadic io posted:you'll be happy to note that Rust has made interop with c++ including c++ oop code a priority for this coming year well, i guess it had a pretty good run sounding like an interesting language. rip.
|
# ? Oct 24, 2016 14:13 |
|
if i had to do this i would legit just swallow clang, and invoke it runtime to build incredibly stupid glue, rather than attempt to make any sense of what happens in c++ interfacing from the outside i expect that is too heavy-handed to fly in that kind of project though
|
# ? Oct 24, 2016 14:22 |
|
Wheany posted:well, i guess it had a pretty good run sounding like an interesting language. rip. worse is better. this is good news, rust just might live
|
# ? Oct 24, 2016 14:42 |
|
what's the point of living if c++ flows through your veins
|
# ? Oct 24, 2016 14:53 |
|
Shaggar posted:one of c#'s greatest strengths is not running on linux. soon windows will run on linux
|
# ? Oct 24, 2016 16:04 |
|
no but linux does already run on windows
|
# ? Oct 24, 2016 16:05 |
|
winux
|
# ? Oct 24, 2016 16:21 |
|
Bloody posted:no but linux does already run on windows the linux subsystem is not linux, but a true emulation/translation layer for linux system calls.
|
# ? Oct 24, 2016 16:26 |
leper khan posted:why not just rename it c++/-- at this point? C±
|
|
# ? Oct 24, 2016 18:41 |
|
c diff
|
# ? Oct 24, 2016 19:05 |
|
Bloody posted:c diff
|
# ? Oct 24, 2016 19:07 |
|
Bloody posted:c diff
|
# ? Oct 24, 2016 19:46 |
|
|
# ? May 18, 2024 02:49 |
|
Bloody posted:c diff
|
# ? Oct 24, 2016 19:52 |