Skip to content
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

CTFE Dot Product #200

Merged
merged 1 commit into from
Aug 17, 2011
Merged

CTFE Dot Product #200

merged 1 commit into from
Aug 17, 2011

Conversation

dsimcha
Copy link
Collaborator

@dsimcha dsimcha commented Aug 17, 2011

Issue 6514: CTFE dot product. This is a trivial change to the syntax to work around issue 6517, which was the only thing keeping the old dotProduct function from working at compile time.

I'd recommend accepting this pull request even if Bug 6517 (http://d.puremagic.com/issues/show_bug.cgi?id=6517) might get fixed soon, since it also improves the unit tests for dotProduct, including testing for CTFE. Also, the workaround for 6517 is a trivial syntactic change that doesn't add any maintenance burden or code complexity.

…to work around issue 6517, which was the only thing keeping the old dotProduct function from working at compile time.

// Test in CTFE
enum ctfeDot = dotProduct(x, y);
static assert(ctfeDot == 2280);
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason why you don't simply write

static assert (dotProduct(x, y) == 2280);

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess that was silly. It's not really worth fixing now that the pull request is merged, though.

andralex added a commit that referenced this pull request Aug 17, 2011
@andralex andralex merged commit dc7fb2a into dlang:master Aug 17, 2011
kuettler pushed a commit to kuettler/phobos that referenced this pull request Feb 6, 2018
ddemangle, flush output for each new demangled line
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.

3 participants