On Fri, 30 May 2014 15:50:41 -0400, Philippe Sigaud
<philippe.sig...@gmail.com> wrote:
I'm trying to 'hide' a type, so as not to see it outside its module. I
want to control the way it's created and used.
I know of Voldemort types and '@disable this', but for now I'm just
trying to use 'private'. Halas, it seems it can be circumvented:
*********
module A;
private struct Hidden {}
Hidden foo() { return Hidden();}
*********
module B;
import A;
void main() {
typeof(foo()) h;
}
*********
Am I misunderstanding something or is that a bug?
Even voldemort types can be declared that way. If you want an opaque
struct, you need to return it by pointer. Otherwise, the user must be able
to know what type it is (otherwise, how would he use it?)
-Steve