[Bf-committers] Using C++11 features in Blender source code?

Sergey Sharybin sergey.vfx at gmail.com
Thu Mar 28 05:53:33 CET 2013


Hi,

I'm skeptical about using C++11. It shall be good reason why to use it. For
my knowledge there's not so much from new standard which isn't relatively
easy implementable with older standards.

For coding it could save some bits of time, but think of platform
maintainers. We're using quite older MSVC for official windows builds and
linux environment also not going to be using brand-new compiler as well.
This could be really PITA for maintenance.

One more thing. It'll also bump build environment requirement for those
who're building blender themselves. And all this CentOS, RedHat
workstations (which are in fact used).. Here i'd say: no benefit for
artists -- don't bump anything.


On Thu, Mar 28, 2013 at 4:43 AM, CoDEmanX <codemanx at gmx.de> wrote:

> I remember a recent discussion about moving from MSVC 2008 to 2010, it
> was rejected / post-poned for a simple reason: the build team members
> don't own 2010 and can't afford the required amount of licenses. And
> community members who want to compile Blender with CUDA support would
> have to upgrade as well if the project moved on to a newer version i guess?
>
>
> Am 27.03.2013 23:16, schrieb Bastien Montagne:
> > iirc, we also need gcc4.2 support (for OSX) ? Guess this one isn’t much
> > C++11-aware either… :/
> >
> > On 27/03/2013 22:16, Manuel Bellersen wrote:
> >> Hey Dalai,
> >>
> >> It's not directly a project list. More a list of things I miss inside
> the
> >> game engine.
> >>
> >> Downsides of C++11…
> >> Probably the worst downside is compiler support for it.
> >> With GCC 4.7 / 4.8 and Clang 3.3 you probably won't have a problem. But
> MS
> >> Visual Studio is again far behind :-(.
> >> Here is a little comparison:
> >>
> http://cpprocks.com/a-comparison-of-c11-language-support-in-vs2012-g-4-7-and-clang-3-1/
> >>
> http://cpprocks.com/c11-compiler-support-shootout-visual-studio-gcc-clang-intel/
> >>
> >> C++11 is fully backwards compatible.
> >> Just your code might not be as clear as it should be ;-)
> >> http://stackoverflow.com/questions/4326045/is-new-c-backward-compatible
> >>
> >> In my Blender branch I used C++11 features and had no real problems so
> far.
> >> In the beginning I had to fix some lines the compiler otherwise would
> have
> >> seen as string literal operators:
> >>
> http://blenderartists.org/forum/showthread.php?283156-Fix-Compiling-BGE-with-C-11-option-gives-errors
> >>
> >>
> >> You are right. Most C code in the game engine is glue to Blender.
> >> But sometimes I find things like assert.h, float.h, math.h, stddef.h,
> >> stdlib.h, stdio.h, malloc, free…
> >> Trying to figure out where the game engine starts drove me through a
> lot of
> >> C - that scared me - and lead to the impression, that there is more in
> the
> >> GE. But it looks quite clear. (I thought that Blender would be total
> C++ …).
> >>
> >>
> >> Hi Mitchell,
> >>
> >> MSVC 2008 sounds really bad.
> >> I guess that means no C++11. Too bad.
> >> In the code I already modified I used things like: auto,shared_ptr, for,
> >> move, array, nullptr, constexpr - just to name some.
> >>
> >>
> >> Thanks for your answers!
> >>
> >> Cheers!
> >> Manuel Bellersen
> >>
> >>
> >> 2013/3/27 Dalai Felinto<dfelinto at gmail.com>
> >>
> >>> Hi Manuel,
> >>> I need to re-visit your post to read it more through, but interesting
> >>> initiative. For some of your projects you may want to drop on irc
> >>> #bgecoders (or even #blendercoders) channel to bounce ideas before
> getting
> >>> down to code. Mainly to smooth out future merges.
> >>>
> >>> Now to your topic:
> >>> Could you elaborate on the downsides of using C++11? (backward
> >>> incompatibility? Lack of compilers? )
> >>> And the problems of mixing it up with the existent C++ code.
> >>>
> >>> Also BGE shouldn't have C code. As far as I can think of, the only
> part in
> >>> C are the dependencies coming from Blender or code for the embedded
> BGE.
> >>>
> >>> Cheers,
> >>> Dalai
> >>> On Mar 27, 2013 7:52 AM, "Manuel Bellersen"<bellersenm at googlemail.com>
> >>> wrote:
> >>>
> >>>> Hey there!
> >>>>
> >>>> I just got in contact with coding Blender, especially the internal
> game
> >>>> engine.
> >>>> (Here is my personal branch https://bitbucket.org/Urfoex/blender/
> >>>> and a little write-up:
> >>>>
> >>>
> http://urfoex.blogspot.com/2013/03/bge-qt5-coding-blender-game-engine.html
> >>> )
> >>>> I like to code using the new features of C++11.
> >>>> But currently Blender isn't using C++11 anywhere.
> >>>> (I think it is kind of funny because it uses Python 3.3 that came out
> >>>> 29.09.2012
> >>>> but doesn't use C++11 which showed up already a year earlier on
> >>>> 12.08.2011.)
> >>>>
> >>>> So the question is:
> >>>> Can I contribute code written using C++11 features?
> >>>> Or am I forced to do the C&  C++ mix I found (and fear)?
> >>>>
> >>>>
> >>>> Best regards,
> >>>> Manuel Bellersen
> >>>> _______________________________________________
> >>>> Bf-committers mailing list
> >>>> Bf-committers at blender.org
> >>>> http://lists.blender.org/mailman/listinfo/bf-committers
> >>>>
> >>> _______________________________________________
> >>> Bf-committers mailing list
> >>> Bf-committers at blender.org
> >>> http://lists.blender.org/mailman/listinfo/bf-committers
> >>>
> >> _______________________________________________
> >> Bf-committers mailing list
> >> Bf-committers at blender.org
> >> http://lists.blender.org/mailman/listinfo/bf-committers
> >>
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
> >
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
With best regards, Sergey Sharybin


More information about the Bf-committers mailing list