How to configure bus for arbitrary number of channels

I’m writing a plugin with arbitrary number of channels (<= 32). I’ve discovered that the bus can be configured with AudioChannelSet with the next numbers of channels: 1…14, 16, 20, 23, 24, 26, 27 - only configurations which are defined in juce_AudioChannelSet.h/cpp. Is it some workaround if I want to have 15 or 17 channels?

You can create any channelset using discreteChannels (int)

auto channels = juce::AudioChannelSet::discreteChannels (17);

There is also canonicalChannelSet(), which will assume a channelset with the number if available (IIUC).

Hope that helps

Thanks Daniel, will try this way

It does not work for me. I check the validity of configuration the next way:
auto channelSet = getSetWithNChannels(i);
auto tempLayouts = bus->getBusesLayoutForLayoutChangeOfBus(channelSet);
if (tempLayouts.getChannelSet(true, 0) == channelSet)
layouts.addItem(String(i), i); // add an item to combobox

So if I realize getSetWithNChannels(i) as 
AudioChannelSet set;
    for (int i = 0; i < nch; ++i)
           set.addChannel(static_cast<AudioChannelSet::ChannelType>(i + 1));
I get the list of channels described in my question. And if I use instead of it 

set = juce::AudioChannelSet::discreteChannels(nch)
I see maximum configuration as 7.1 surround. I’m a newbee in JUCE. May be I do smth wrong?