Enable new Grid demo in Linux?

I see a new Grid class in v5.1.2. But when I run the JuceDemo, the grid demo doesn’t show up.

Hunting around a bit, the Grid demo is in a #if JUCE_HAS_CONSTEXPR, which evaluates to false for me. I’m using g++ 6.3.0 in Ubuntu 17.04. From what I can tell, g++ does have support for constexpr, not sure why that is set to false.

What I am I missing to see the Grid demo? I’m especially curious to see the difference between Flex and Grid. The doxygen help is light on details with both of these relatively new classes.

Well… we check the __cpp_constexpr macro, which is AFAIK the correct way to test for it on GCC. Maybe it’s just missing from 6.3.0?

I’d never heard of __cpp_constexpr before. Is it possible you’re checking that macro without also passing in the --c++11 option? That would explain why JUCE thinks g++ doesn’t support C++11.

GCC claims to support it:
C++ Standards Support in GCC - GNU Project (see SD-6 Feature Test column)

But you are right, gcc on linux does not like it.

OK. I see I think it needs the __has_feature macro. I’ll push a fix.

thanks for the heads up about the Grid class. Very useful looking, I’ve been planning a grid layout keyboard for some time, obviously I was waiting for this class :slight_smile: