Originally posted by mr_tawan
View Post
Announcement
Collapse
No announcement yet.
The Khronos Group's Vulkan, SPIR-V & OpenCL 2.1 Presentations
Collapse
X
-
Originally posted by gens View Postgranted i don't know much cpp, so i may be wrong and there could be such a directive
but how would you go about aligning your memory to 4k (or 16bytes) by using just cpp ?
Comment
-
-
Originally posted by gens View Postyou were the one that started all this talk about language performance, not me
for one, i don't view the use of C in C++ as an argument that they are the same performance wise
C++ is an OO language
meaning that everything is an "object"
meaning that everything has to be encapsulated with metadata (edit: "should" be encapsulated, since it's not OO if it isn't)
the compiler could compile that abstraction layer away, but only if it gets the whole program at once (no linking at all, linking means function input evaluation)
(think function overloading in C)
C++ is a general purpose language that has OO features, meaning everything can be an "object".
C++ is a multi paradigm language, where the programmer much choose the language features that are fit for a given problem. This can be a problem as well as a solution, but what is certain is that there is no single "true" way to write c++, and if it's best to locally go to a C-like features level, so be it.
C++ can do C performance, and can use higher level designs (but not always at the same time, obviously). That doesn't mean you must.
Comment
Comment