In JUCE 6 it will be possible to choose to use int instead of size_t in the dsp class?

Having said all this I do drift as well. I’ll probably be arguing for unsigned next week…

Well, I’m arguing for a #define on this one so new users can have the luxury of not having cast but old code wont’ need to change !

So we all agree: Jules’ keynote at the next ADC will consist of nothing but a coin toss:

heads = signed
tails = unsigned

Mic drop, followed by a riot in the audience no matter which way it goes.


@ed95 It’s settled then? :slight_smile:

Can i just say that a #define is a very bad choice. I’d rather stick with size_t if that’s the only other option.

If you’re writing a library using AudioBlock there’s then no way to know what type will be returned by it so I’ll have to cast to the define type or use some decltype tricks to get the type. Either way the behaviour and hence all the internal maths would magically change depending on how the user compiles the library. No way do I want to be debugging that!


Is anyone against swapping the whole thing to use int? :slight_smile:

We hear you, and it’s something that we need to discuss a bit internally first. There’s something to be said for minimising the breaking changes to everyone’s existing code and making the transition from JUCE 5 -> 6 as painless as possible, so it will be something we’ll look into after the release this month.

1 Like