you don't actually need to create 2 objects like this to share code...
you can achieve what you want (shared code) by defining functions in header files with the noinline attribute e.g
this will define 'normal' functions without inlining (duplicating) them.
you can see an example of this with my 'push' object.
the advantage of this approach is, users of your objects don't have to care about this 'optimisation', they just use your lfo objects as 'normal'.
also I suggest like my push object, you split the code into headers and source files, at the moment it makes no difference BUT with the next release we will allow for compile units, and having the code already split will make that transition 'trivial'
a word of caution (for either approach ), inline-ing is done by default for good reason, since we usually want best performance in audio applications (esp. given limited cpu, being used RT) - even slow k-rate code, could give users audio issue, as its all has to be executed in the same time slice.
An unfortunate part, is users currently have few ways of determining which part of their code is taking too much time to execute, so building big patches with lots of un-inlined code, could be a frustrating experience.
anyway, not saying its not a good idea/ useful, merely we have to recognise its a space vs time optimisation... thats it needs to be handled with care, nothing in life is free