Re: C++ and derived classes issue

2016-02-15 Thread Geert Janssens
On Monday 15 February 2016 13:43:03 Larry Evans wrote: > On 02/13/2016 05:56 PM, Larry Evans wrote: > [snip] > > > The following Gist illustrates this mpl::vector prototype: > > > > https://gist.github.com/cppljevans/30990f76f6d2917f21c8 > > To anyone interested in the above, please download it

Re: C++ and derived classes issue

2016-02-15 Thread Larry Evans
On 02/13/2016 05:56 PM, Larry Evans wrote: [snip] > The following Gist illustrates this mpl::vector prototype: > > https://gist.github.com/cppljevans/30990f76f6d2917f21c8 > To anyone interested in the above, please download it within the next 2 days. After that, I'll deleted from

Re: C++ and derived classes issue

2016-02-13 Thread Geert Janssens
On Friday 12 February 2016 17:15:41 John Ralls wrote: > > On Feb 12, 2016, at 1:09 PM, Geert Janssens > I think that what you really want to do is > > template class GncTransProperty { > public: > GncTransProperty (T x, GncTransPropType p) : value{x}, property{p} > {}; T get_value() const {

Re: C++ and derived classes issue

2016-02-13 Thread Larry Evans
On 02/12/2016 07:15 PM, John Ralls wrote: > >> On Feb 12, 2016, at 1:09 PM, Geert Janssens wrote: >> >> Hi, >> >> While working to convert the csv importer to c++ I've come across this issue: [snip] >> To avoid code duplication, I chose to replace the struct with a

Never Mind( was Re: C++ and derived classes issue

2016-02-13 Thread Larry Evans
On 02/13/2016 10:10 AM, Larry Evans wrote: [snip] > Wouldn't code here: > > https://github.com/gjanssens/gnucash/blob/cpp/src/import-export/csv-imp/gnc-trans-props.hpp#L177 > > also have to be changed? Currently, it has: > > /** A struct containing TransProperties that all describe a single >

Re: C++ and derived classes issue

2016-02-13 Thread Geert Janssens
On Saturday 13 February 2016 10:10:25 Larry Evans wrote: > On 02/12/2016 07:15 PM, John Ralls wrote: > >> On Feb 12, 2016, at 1:09 PM, Geert Janssens > > wrote: > >> Hi, > >> > >> While working to convert the csv importer to c++ I've come across > > this issue: >

Re: C++ and derived classes issue

2016-02-13 Thread Geert Janssens
(I don't know why but my mail got mangled while going through the intertubes. I'll try to resend. Hopefully this time it comes through ok.) On Friday 12 February 2016 17:15:41 John Ralls wrote: > > On Feb 12, 2016, at 1:09 PM, Geert Janssens > I think that what you really want to do is > >

Re: C++ and derived classes issue

2016-02-13 Thread Geert Janssens
(Nope, part is still cut off... I'll send that part separately now, hopefully that works.) Missing part from previous mail: ... 5. You propose to make all the possible import items properties of the Transaction GObject. I'm not really in favor of that as several of these import items are

Re: C++ and derived classes issue

2016-02-13 Thread John Ralls
> On Feb 13, 2016, at 9:56 AM, Geert Janssens > wrote: > > (Nope, part is still cut off... I'll send that part separately now, hopefully > that works.) > > Missing part from previous mail: It all came through OK to me directly. The list must have mangled it. I'm

Re: C++ and derived classes issue

2016-02-13 Thread John Ralls
> On Feb 13, 2016, at 8:02 AM, Geert Janssens > wrote: > > On Friday 12 February 2016 17:15:41 John Ralls wrote: > > > On Feb 12, 2016, at 1:09 PM, Geert Janssens > > I think that what you really want to do is > > > > template class GncTransProperty { > > public:

Re: C++ and derived classes issue

2016-02-13 Thread Larry Evans
On 02/13/2016 01:03 PM, John Ralls wrote: [snip] > You started out trying to encapsulate an object and a flag that indicated where to put it. That had genericity problems because there's no type-safe way to generically handle the differing return types. Polymorphism to the rescue! Except that it

Re: C++ and derived classes issue

2016-02-13 Thread John Ralls
> On Feb 13, 2016, at 12:25 PM, Larry Evans wrote: > > > > On 02/13/2016 01:03 PM, John Ralls wrote: > [snip] >> You started out trying to encapsulate an object and a flag that > indicated where to put it. That had genericity problems because there's > no type-safe

Re: C++ and derived classes issue

2016-02-13 Thread Larry Evans
On 02/13/2016 03:14 PM, John Ralls wrote: > >> On Feb 13, 2016, at 12:25 PM, Larry Evans wrote: >> >> >> >> On 02/13/2016 01:03 PM, John Ralls wrote: >> [snip] >>> You started out trying to encapsulate an object and a flag that >> indicated where to put it. That had

Re: C++ and derived classes issue

2016-02-13 Thread Larry Evans
On 02/13/2016 03:14 PM, John Ralls wrote: > >> On Feb 13, 2016, at 12:25 PM, Larry Evans wrote: >> >> >> >> On 02/13/2016 01:03 PM, John Ralls wrote: >> [snip] >>> You started out trying to encapsulate an object and a flag that >> indicated where to put it. That had

C++ and derived classes issue

2016-02-12 Thread Geert Janssens
Hi, While working to convert the csv importer to c++ I've come across this issue: At some point the importer code wants to keep track of a set of values that can be used to create a transaction from. The transactions can't be created immediately in that part of the code because user

Re: C++ and derived classes issue

2016-02-12 Thread John Ralls
> On Feb 12, 2016, at 1:09 PM, Geert Janssens > wrote: > > Hi, > > While working to convert the csv importer to c++ I've come across this issue: > > At some point the importer code wants to keep track of a set of values that > can be used to > create a