Skip to content

add ADL example to std.traits.moduleName#4762

Closed
WalterBright wants to merge 1 commit intodlang:masterfrom
WalterBright:traits-adl
Closed

add ADL example to std.traits.moduleName#4762
WalterBright wants to merge 1 commit intodlang:masterfrom
WalterBright:traits-adl

Conversation

@WalterBright
Copy link
Member

Example shows how to do ADL lookup for those who want it.

module myalgorithm;

// Find module in which T was defined
template ModuleOf(alias T)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this template should be in std.traits and the rest of your example should be part of its documentation.

Copy link
Member Author

@WalterBright WalterBright Sep 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, but prefer to wait and see if this template is more widely useful first.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @tgehr, well both actually. I'm kind of surprised that ModuleOf is not there yet. We only have https://dlang.org/phobos/std_traits.html#moduleName.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One interesting question: should this be moduleOf or ModuleOf? Given the convention for modules it may even be arguably module_of :)

@andralex
Copy link
Member

@WalterBright ping

@JackStouffer
Copy link
Contributor

Closing due to inactivity of the PR author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants