Benito van der Zander via fpc-pascal <fpc-pascal@lists.freepascal.org> schrieb am Mo., 11. Jan. 2021, 15:26:
> Hi, > > perhaps a safe, generic function for this copying could be added to the > RTL. Like: > > Procedure ManagedMove<T>(const source: T;var dest: T;count: SizeInt); > In principle a good idea. However this is one of those cases where you'd definitely need to use constref instead of const. And when you use IsManagedType, it does not distinguish standard strings > with such weird managed types. > You can additionally use GetTypeKind as well. Unlike TypeInfo it directly returns the TTypeKind (which for this case is enough) and is considered constant. And perhaps there could be a special attribute to mark which kind of moving > is needed, e.g.. > type [moveable] TA = record > type [referencecounted] TA = record > type [nonmoveable] TA = record > No, thank you. Regards, Sven
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal