Hi,
I personally separate OS-specific implementations in modules with
the same name, in different directories. From the filesystem
perspective:
widget.d
linux/widgetimpl.d
windows/widgetimpl.d
From the code perspective, the *impl modules would present
homonymic types with the same public
On Tuesday, 7 June 2016 at 15:33:57 UTC, chmike wrote:
Hello
I'm writing some code that I want to be portable across Posix
and Windows.
What is the recommended code convention for such type of code ?
80% of the class implementation is the same for both OS.
Should I write the following and
On Tuesday, 7 June 2016 at 15:33:57 UTC, chmike wrote:
or should I do it the C way with multiple embedded static if...
In your example, `version` would also work instead of `static if`.
I would not copy much code needlessly, and go with the embedded
version/static ifs.
- Johan
On Tuesday, 7 June 2016 at 15:33:57 UTC, chmike wrote:
Hello
I'm writing some code that I want to be portable across Posix
and Windows.
What is the recommended code convention for such type of code ?
80% of the class implementation is the same for both OS.
Should I write the following and
Hello
I'm writing some code that I want to be portable across Posix and
Windows.
What is the recommended code convention for such type of code ?
80% of the class implementation is the same for both OS.
Should I write the following and copy past the 80%
version( Windows ) {
import