[Bf-committers] Status of C++

Wolfgang Draxinger wdraxinger.maillist at draxit.de
Mon Nov 15 23:24:13 CET 2010

Am Mon, 15 Nov 2010 22:11:41 +0100
schrieb Leo Sutic <leo.sutic at gmail.com>:

> I wasn't really asking for an opinion of C++, I was asking what the
> community had decided, if anything, in regards to use of the language.

Using C++ in the Blender Kernel would be very troublesome. For one
thing C++ would ruin the whole DNA system. Then most Blender data
structures are organized in form of simple linked objects. If you use
smart_ptr on them things will break.

Doing this kind of thing, which DNA does, sanely in C++ (and with that
I mean also using classes, whistles and bells) is a nightmare.
std::vector would be of only little use, mostly a replacement for
standard C arrays, which are already covered by Blender's guarded
alloc. And if you'd use templates somewhere near the type system then
you introduce a whole new set of problems. Of course some external
helpers may very well be implemented in C++. However if you want to
integrate a larger set of things implemented in C++, one must ask:
Which features subset I am willing to limit myself. As it turns out,
this feature subset boils down to very little above plain C, but with
worse semantics.

And Blender is already in this situation. GHOST, parts of the math
library, Bullet have been implemented in C++, but they're mostly
incompatible among themself and need that C glue between them.


More information about the Bf-committers mailing list