[fpc-pascal] String conversions

Ryan Joseph genericptr at gmail.com
Tue Jun 25 20:23:17 CEST 2019



> On Jun 25, 2019, at 2:16 PM, Jonas Maebe <jonas at freepascal.org> wrote:
> 
> On 25/06/2019 20:15, Ryan Joseph wrote:
>> I’m making some string helper functions and using ansistring as inputs (in case there are longer strings than 255 chars). What happens when you pass a short string as an ansistring? Does the compiler have to allocate a new ansistring or can it do some smart optimization? 
> 
> It has to allocate a new ansistring.

Ouch. That means I need to make lots of overloads. This is a prime candidate for generics then but I’m still waiting for my “implicitfunctionspecializations” modeswitch patch to be accepted.

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list