D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11842 - Operator overloading of named mixin templates
Summary: Operator overloading of named mixin templates
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords: rejects-valid
: 12159 (view as issue list)
Depends on:
Blocks:
 
Reported: 2013-12-29 13:50 UTC by Vladimir Panteleev
Modified: 2024-12-13 18:15 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2013-12-29 13:50:54 UTC
This code ought to work:

mixin template M()
{
	bool opIn_r(int i) { return true; }
}

struct S
{
	mixin M m;
}

void main()
{
	S s;
	assert(5 in s.m);
}
Comment 1 Andrej Mitrovic 2014-02-14 12:59:20 UTC
*** Issue 12159 has been marked as a duplicate of this issue. ***
Comment 2 Simen Kjaeraas 2020-05-25 12:25:16 UTC
See also issue 5158.
Comment 3 dlangBugzillaToGithub 2024-12-13 18:15:28 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18744

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB