the DSP module requires a C++14 compiler so constexpr should be fine here (unlike in other JUCE modules)
std::array is used instead of a raw array, it doesnât really compete with juce::Array. I personally prefer std::vector to juce::Array because it uses size_t.
I know @jules doesnât like raw casts even for trivial type conversions but heâd probably agree that using static_cast everywhere in this particular class would make it less readable.
Hello @zsolt ! So I guess this is class is your work
For the constexpr stuff, I was writing a remark because I saw on the JUCE base code that VS2015 isnât supposed to handle it correctly. And indeed, in some specific contexts, it doesnât work as expected. Thatâs the reason why the GridDemo in the demo JUCE app for example canât be compiled with VS2015. However, I have been using the DSP module with VS2015 for a while (I use VS2017 now) so I was wondering if something was wrong somewhere. I think that the DSP module shouldnât be compatible with VS2015 to be consistant everywhere for exampleâŠ
OK so thatâs a signal to say âstop using juce::Array and use the std variants instead from nowâ I guess
Iâm still writing static_cast everywhere since my days in London I agree it makes the code less readable in general
We might add some overloads one day to help with this.
(But using an unsigned index type is apparently something that a lot of C++ gurus nowadays consider to have been a regrettable choice in the standard library)
Yeah, I can see losing some functionality due to handy things like using a -1 index as shorthand for âat the end or the containerâ. Overloads alone would make a huge positive difference.
in my experience unsigned ints have proven to be quite annoying in math operations when sometimes you just want to e.g. do a simple -1 temporarily as a part of an expression and you end up in positive max for the type, I find using unsigned error prone and requiring special attention.