[fpc-pascal] Compiler Warning: Constructor should be public

"Vinzent Höfler" JeLlyFish.software at gmx.net
Wed Nov 11 20:04:11 CET 2009


Graeme Geldenhuys <graeme at mastermaths.co.za>:

> A very quick and dirty solution would be to reimplement the public
> Create() constructor and immediately raise an exception inside it,
> explaining the problem. That way if any developer tries to use that
> default constructor, they will get an error - instead of some silent
> side-effect later on. Then implement a new public custom constructor
> with your desired code.

Why "public" then? Perhaps I don't *want* the user to create instances of this class in an uncontrolled way?


Vinzent.
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser



More information about the fpc-pascal mailing list