TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

C++ object model and other internals explained with simple C code

67 pointsby hanifviraniabout 14 years ago

7 comments

faragonabout 14 years ago
Unfortunately, C++ internals change from compiler to compiler, even from same manufacturer between updates, making impossible usable C++ dynamic libraries safely (C calling conventions are standard, while that is not enough for C++, because of class handling). Unless that becomes solved, C++ will never be able to compete with C for library and system development.
eliasmacphersonabout 14 years ago
I will struggle my way through this, having mostly given up on "Inside the C++ Object Model" by Stan Lippman. I have heard it said that Lippman's book is very out of date and a lot of it doesn't apply to modern compilers.<p>Link seems to be down, although some of it is cached by google. Is there a way to use google webcache to edit the hyperlinks in a cached article so that they point to cached versions of the target?
评论 #2386146 未加载
malkiaabout 14 years ago
In our past games, we had extensive C++ serialization (marshalling, pickling, whatever you call it).<p>We had to fight gcc 2.95, metrowerks, and few other compilers putting the "virtual table pointer" at different places - begining of object, end, etc. Then alignment differences (not strictly C++), and bitfields. Hopefully mangling was avoided, as we did not had to reference at runtime the data, we had pointers.<p>It was quite messy, and you could not reuse exported data - had to be for each platform/compiler.
cawhitworthabout 14 years ago
Worth noting that this is very gcc specific. Implementation details will vary across compilers, but it's not made clear.
评论 #2385737 未加载
swahabout 14 years ago
I'm getting:<p><pre><code> PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in lock_may_be_available() (line 165 of /srv/www/avabodh.com/public_html/includes/lock.inc).</code></pre>
评论 #2385200 未加载
rdtscabout 14 years ago
It is also worth highlighting that extensive object oriented systems can and have been built on top of C :<p><a href="http://library.gnome.org/devel/gobject/stable/" rel="nofollow">http://library.gnome.org/devel/gobject/stable/</a>
jprabout 14 years ago
If C++ can be explained adequately with <i>simple</i> C code, why use C++ in the first place?
评论 #2386136 未加载
评论 #2386505 未加载
评论 #2386517 未加载