# RefCountedPairArray

**URL:** <https://forum.juce.com/t/refcountedpairarray/1402>\
**Category:** General JUCE discussion\
**Created:** [January 24, 2007, 9:46pm UTC](https://forum.juce.com/t/refcountedpairarray/1402 "2007-01-24T21:46:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_Wheaton](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Bruce\_Wheaton](https://forum.juce.com/u/Bruce_Wheaton)\
**Post date:** [January 24, 2007, 9:46pm UTC](https://forum.juce.com/t/refcountedpairarray/1402/1 "2007-01-24T21:46:11Z")

</div>

Anything like this on the drawing board or does anyone have something to share? I’d rather use a juce version that cobble together boost and STL. I see there’s a string pair array, so it seems like the basics would be there.

Bruce

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 25, 2007, 9:58am UTC](https://forum.juce.com/t/refcountedpairarray/1402/2 "2007-01-25T09:58:52Z")

</div>

Hadn’t considered it, because I guess I’ve never needed such a thing myself. I’ll pop it on my to-do-list though.

---

<div class="post-metadata">

**Author:** ![Bruce\_Wheaton](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Bruce\_Wheaton](https://forum.juce.com/u/Bruce_Wheaton)\
**Post date:** [January 25, 2007, 6:59pm UTC](https://forum.juce.com/t/refcountedpairarray/1402/3 "2007-01-25T18:59:18Z")

</div>

Great, thanks. Will referencecountedobject work in a std::map? I seem to remember a lot of things won’t.

I know boost::shared\_ptr will, but I’m not sure I want to deal with three platforms of boost installs.

Bruce

---

<div class="post-metadata">

**Author:** ![Bruce\_Wheaton](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Bruce\_Wheaton](https://forum.juce.com/u/Bruce_Wheaton)\
**Post date:** [January 25, 2007, 7:48pm UTC](https://forum.juce.com/t/refcountedpairarray/1402/4 "2007-01-25T19:48:12Z")

</div>

Scratch that. I think I’ll go for an OwnedArray sub-class with a key string array attached. Is that about the way you’d do it Jules? I see StringPair has two string array members, but it seems like that, in this case, would still require re-writing a lot of ownedarray to keep the two in sync, so making a sub-class would be easier.

I should probably have asked for an owned array, not ref counted anyway. I suppose the ‘best’ would actually be to go back to the base class and add a key set so that they all get it? Is there some way to add it to the array class and have it inactive unless needed? That way it could get access to all the array operations in order to stay in sync.

Or am I barking up the wrong tree?

Bruce

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 12, 2017, 8:58pm UTC](https://forum.juce.com/t/refcountedpairarray/1402/5 "2017-05-12T20:58:11Z")

</div>

Closed on May 12, 2017, 8:58pm UTC


