Skip to content

Remove pure nothrow @nogc from input range version of byXchar #2483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2014

Conversation

schuetzm
Copy link
Contributor

@schuetzm schuetzm commented Sep 2, 2014

The functions are templated and get their attributes deduced. With the explicit annotations, it's impossible to use the byXchar family of functions with non-pure/throw/gc ranges.

@dnadlinger
Copy link
Member

What about adding a quick unit test with a system/…/range?

@quickfur
Copy link
Member

quickfur commented Sep 2, 2014

Please add:

  1. A pure, @safe, nothrow unittest that instantiates each of these functions with a range that's known to be pure, @safe, etc.. This is to ensure the code itself does not violate these attributes.

  2. An impure, @system, throwing unittest that instantiates each of these functions with a range whose methods are impure, perform @system operations (this can be as simple as calling a function marked @system), and throw exceptions. This is to ensure that the template functions are instantiable with impure, @system, etc., ranges.

@schuetzm schuetzm force-pushed the make-byxchar-unpure-gc-throw branch from a5f671f to 809ae08 Compare September 3, 2014 18:20
@schuetzm
Copy link
Contributor Author

schuetzm commented Sep 3, 2014

@quickfur Done.

@monarchdodra
Copy link
Collaborator

LGTM

// test pure, @safe, nothrow correctness of byChar/byWchar/byDchar, which needs
// to support ranges with and without those attributes

pure @safe nothrow unittest {
Copy link
Member

Choose a reason for hiding this comment

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

No Egyptian braces, please.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is missing @nogc.

The functions are templated and get their attributes deduced.
@schuetzm schuetzm force-pushed the make-byxchar-unpure-gc-throw branch from 809ae08 to 61921f6 Compare September 4, 2014 08:05
@quickfur
Copy link
Member

quickfur commented Sep 4, 2014

LGTM, thanks!

@quickfur
Copy link
Member

quickfur commented Sep 4, 2014

Auto-merge toggled on

quickfur pushed a commit that referenced this pull request Sep 4, 2014
Remove pure nothrow @nogc from input range version of byXchar
@quickfur quickfur merged commit dea935d into dlang:master Sep 4, 2014
@schuetzm schuetzm deleted the make-byxchar-unpure-gc-throw branch September 4, 2014 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants