Am 22.03.2015 um 04:40 schrieb Martin Nowak:

Why would export make private functions public?


Following problem:

// public template
void foo(T)(T arg)
{
  bar(T.sizeof);
}

// private implementation helper
private void bar(size_t size) { ... }


Because bar is used from foo, bar has to be exported, thus the protection level has to be changed from "private" to "export". But "export" includes "public" so the function bar will now be public as well.

This problem was exessivly discussed here: http://forum.dlang.org/thread/m9lhc3$1r1v$1...@digitalmars.com

The official response from Walter and Andrei was, that they don't want any language change and symbols that need exporting should just become public.

But this in turn will mean that tons of currently private helper functions without documentation will become public and cause errors or warnings in ddoc.

Kind Regards
Benjamin


Reply via email to