D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6664 - BufferedFile this(HANDLE) uses undefined type.
Summary: BufferedFile this(HANDLE) uses undefined type.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 12:27 UTC by Jerry Quinn
Modified: 2016-10-14 23:01 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jerry Quinn 2011-09-13 12:27:30 UTC
HANDLE is a Windows-specific type.  It doesn't belong in the general Phobos API.

However if it's going to be there, it needs to be a documented type and be obtainable in a platform-independent manner.
Comment 1 Vladimir Panteleev 2011-09-13 12:38:11 UTC
You are misunderstanding the purpose of such constructors.
Comment 2 Vladimir Panteleev 2011-09-13 12:42:12 UTC
Ignore my last comment.

HANDLE is aliased to int on Posix. BufferedFile is inside std.stream, and the constructor which takes a HANDLE is not in a version(Windows).
Comment 3 Vladimir Panteleev 2011-09-13 12:45:18 UTC
Sorry for the knee-jerk close, I thought you were talking about something in std.stdio which allows construction from a HANDLE on Windows platforms.

For the record, std.stream is generally regarded as obsolete code which simply hasn't been rewritten yet. You may find that this is by far not the only poor design decision in the module.
Comment 4 Jerry Quinn 2011-09-13 13:16:39 UTC
(In reply to comment #3)
> Sorry for the knee-jerk close, I thought you were talking about something in
> std.stdio which allows construction from a HANDLE on Windows platforms.
> 
> For the record, std.stream is generally regarded as obsolete code which simply
> hasn't been rewritten yet. You may find that this is by far not the only poor
> design decision in the module.

That's certainly fine.  It might make sense to put a note at the top of the std.stream page that features are subject to change.
Comment 5 Andrei Alexandrescu 2016-10-14 23:01:01 UTC
no more std.stream -> this gets closed