Re: OOP question: deduplicating code across two subclasses

2022-12-10 Thread Scott Kostyshak
On Sun, Dec 11, 2022 at 12:31:18AM +0100, Thibaut Cuvelier wrote: > On Sat, 10 Dec 2022 at 23:12, Scott Kostyshak wrote: > > > On Sat, Dec 10, 2022 at 10:36:51PM +0100, Thibaut Cuvelier wrote: > > > On Sat, 10 Dec 2022 at 17:19, Scott Kostyshak wrote: > > > > > > > PreambleModule::editExternal()

Re: OOP question: deduplicating code across two subclasses

2022-12-10 Thread Thibaut Cuvelier
On Sat, 10 Dec 2022 at 23:12, Scott Kostyshak wrote: > On Sat, Dec 10, 2022 at 10:36:51PM +0100, Thibaut Cuvelier wrote: > > On Sat, 10 Dec 2022 at 17:19, Scott Kostyshak wrote: > > > > > PreambleModule::editExternal() and LocalLayout::editExternal() share > > > most of their code. The functions

Re: OOP question: deduplicating code across two subclasses

2022-12-10 Thread Scott Kostyshak
On Sat, Dec 10, 2022 at 10:36:51PM +0100, Thibaut Cuvelier wrote: > On Sat, 10 Dec 2022 at 17:19, Scott Kostyshak wrote: > > > PreambleModule::editExternal() and LocalLayout::editExternal() share > > most of their code. The functions are pretty small, so there's not too > > much duplication as a

Re: OOP question: deduplicating code across two subclasses

2022-12-10 Thread Thibaut Cuvelier
On Sat, 10 Dec 2022 at 17:19, Scott Kostyshak wrote: > PreambleModule::editExternal() and LocalLayout::editExternal() share > most of their code. The functions are pretty small, so there's not too > much duplication as a whole. However, I'm still curious. How would I > best deduplicate the code?

OOP question: deduplicating code across two subclasses

2022-12-10 Thread Scott Kostyshak
PreambleModule::editExternal() and LocalLayout::editExternal() share most of their code. The functions are pretty small, so there's not too much duplication as a whole. However, I'm still curious. How would I best deduplicate the code? In this case I wonder if a friend function might be the best c