O'Reilly logo

Getting Started With JUCE by Martin Robinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using dynamically allocated arrays

While most instances of JUCE objects can be stored in regular C++ arrays, JUCE offers a handful of arrays that are more powerful, somewhat comparable to the C++ Standard Library classes, such as std::vector. The JUCE Array class offers many features; these arrays can be:

  • Dynamically sized; items can be added, removed, and inserted at any index
  • Sorted using custom comparators
  • Searched for particular content

The Array class is a template class; its main template argument, ElementType, must meet certain criteria. The Array class moves its contents around by copying memory during resizing and inserting elements, this could cause problems with certain kinds of objects. The class passed as the ElementType template argument ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required