ValueTreeSynchroniser::getRoot()


#1

Why does this need to return a const ValueTree object?  It seems unnecessarily cruel...


#2

Because if it returned a non-const ref then you could redirect it to point at a completely different tree, and IIRC that'd confuse the synchroniser logic..


#3

Fair enough, but It's not very exciting getting a const ref back.  How about return by value for this one?


#4

What are you trying to do with it? You can always create a ValueTree from the reference to get/set properties (assuming you're not dealing with the listener list).


#5

But you can already get a by-value copy from it, right?

e.g.

ValueTree myCopy = syncThing.getRoot();

?


#6

I was trying to use it as a parameter for applyChange...


#7

Ah - turns out what I was trying to do was bonkers anyway.  Best ignore/delete this thread.

Or leave it as a monument to my folly...