PluckedStrings demo and C++11


#1

Hello Jules !

I have spent some time trying all the new example projects, and I have to say that I am very grateful of you and your new team for having shared all these toys with us ;)

I have just questions about the PluckedStrings demo. I am working mainly with Visual Studio 2008 on Windows XP / 7 nowadays, which is bad I know, so I had to make a few changes on this demo to be able to compile it. Indeed, it uses a lot of stuff from C++11 (auto keyword, initialisation of variables in the class declaration, std::vector uses), so I had to rewrite a few things in old C++ style. Which is in general easy to do with (a lot) more code lines, so I can see the interest of doing everything with this new syntax :)

I just would like to know what is your position here. Should we have more C++11 code in JUCE in the next months/years, or do you want to keep the source code compatible with most of the compilers if possible ?

Thanks in advance ;)


#2

Why are you still using Vs2008?


#3

Well my Windows computer isn't very recent, and once I tried VS2010 and it was slow like hell, so I decided to keep VS2008


#4

Our general policy is that the main library obviously needs to maintain compatibilty with old compilers for at least the next couple of years. 

But old compilers are a minority now, and we're not going to be too strict about keeping modern code out of all the minor examples. Letting a few bits of modern C++ into a couple of the examples isn't a bad thing IMHO. And certainly now that we're introducing classes that can use lambdas, we'll actively want to start having a few examples that demonstrate these things.


#5

Thanks for the clarification ;) It's time to try the free VS2013 Community edition I think !


#6

My development environment is stuck at OSX 10.6.8, Xcode 3.2.6, and using JUCE 3.2.0 plus I am still learning C++. Success with JUCE has been good so far. The plucked string demo is producing errors which I am assuming is due to version changes in something (e.g. C++11? as noted by Wolfen above).  The are 60 errors starting in  stringsynthesiser.h at line 98

98 std::generate (excitationSample.begin(), 

   excitationSample.end(),

  [] { return (Random::getSystemRandom().nextFloat() * 2.0f) - 1.0f; } );

with the message Exepcted primary-expression before'[' token ...

Kindly point me in the direction of what I need to do to fix this sort of error.

Many thanks in advance  


#7

That's C++11. Some of our demo code uses C++11 although the library itself doesn't require it.. yet.

I'd strongly encourage you to update your tools - there's a growing appetite in the C++ community to get tough with the few people who are still clinging to older compilers, and we'll drop support for C++03 entirely at some point in the not-too-distant future.


#8

Fair enough! Thanks