Re: [fpc-pascal] Generic operator overload problem

2019-11-08 Thread Sven Barth via fpc-pascal
Am 02.11.2019 um 15:01 schrieb Ryan Joseph via fpc-pascal: Is this a bug or did I do something wrong? The minus operator overload seems to be getting confused and I get a "Can't determine which overloaded function to call" error as a result. {$mode objfpc} {$modeswitch advancedrecords} progra

Re: [fpc-pascal] Generic type conflicts

2019-11-08 Thread Sven Barth via fpc-pascal
Am 02.11.2019 um 15:55 schrieb Ryan Joseph via fpc-pascal: I've wanted to make a generic version of a vector for a while but I always give up because it seems not very possible. It's probably not even a great idea because many methods don't translate between float and integer but I wanted to p

Re: [fpc-pascal] Generic type conflicts

2019-11-08 Thread Ben Grasset via fpc-pascal
On Fri, Nov 8, 2019 at 11:18 AM Ben Grasset wrote: > I know what you mean, and I'm aware, but you actually kind of can to the > fairly straightforward extent that I'm concerned about with Ryan's patch > (i.e. simply passing constant results as constraints rather than function > parameters.) > Al

Re: [fpc-pascal] Generic type conflicts

2019-11-08 Thread Jonas Maebe
On 08/11/2019 17:18, Ben Grasset via fpc-pascal wrote: > On Fri, Nov 8, 2019 at 11:04 AM Jonas Maebe > wrote: > > You can't. It's the main difference between C++ templates, which is a > Turing-complete programming language, and generics, which is simply a >

Re: [fpc-pascal] Generic type conflicts

2019-11-08 Thread Ben Grasset via fpc-pascal
On Fri, Nov 8, 2019 at 11:04 AM Jonas Maebe wrote: > You can't. It's the main difference between C++ templates, which is a > Turing-complete programming language, and generics, which is simply a > parametrising mechanic. > I know what you mean, and I'm aware, but you actually kind of can to the

Re: [fpc-pascal] Generic type conflicts

2019-11-08 Thread Jonas Maebe
On 08/11/2019 17:02, Ben Grasset via fpc-pascal wrote: > The original C++ version used "constexpr" template parameters to > determine at compile time whether or not the user-provided comparison > function was one for which it should use the "branchless" version of its > code for item partitioning o

Re: [fpc-pascal] Generic type conflicts

2019-11-08 Thread Ben Grasset via fpc-pascal
On Fri, Nov 8, 2019 at 1:33 AM Michael Van Canneyt wrote: > As an aside: > In my opinion (keep in mind I am not a big fan of generics) the above code > would be a prime example where one should not be using generics, but > simple overloads. > If you need to use GetTypeKind in a generic, I think y

Re: [fpc-pascal] FCL-DB Classes Implementation.

2019-11-08 Thread Michael Van Canneyt
Once it is initially working, I will push it to svn. michael. On Fri, 8 Nov 2019, Kakoulidis Ioulianos via fpc-pascal wrote: Michael, can you share code? Regards. От: fpc-pascal от имени Michael Van Canneyt Отправлено: 31 октября 2019 г. 10:09 Кому: FPC-P

Re: [fpc-pascal] StringList micro optimization

2019-11-08 Thread Michael Van Canneyt
On Fri, 8 Nov 2019, AlexeyT via fpc-pascal wrote: Procedure TStrings.SetDelimitedText(const AValue: string);  has about 16 calls to Length(AValue), so make a variable NLen to speed up it. Optimized, thanks for the hint. Also reworked it so AddDelimitedText reuses DelimitedText code, no temp

Re: [fpc-pascal] FCL-DB Classes Implementation.

2019-11-08 Thread Kakoulidis Ioulianos via fpc-pascal
Michael, can you share code? Regards. От: fpc-pascal от имени Michael Van Canneyt Отправлено: 31 октября 2019 г. 10:09 Кому: FPC-Pascal users discussions Тема: Re: [fpc-pascal] FCL-DB Classes Implementation. On Wed, 30 Oct 2019, Kakoulidis Ioulianos wrote: