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

Adding constexpr keywords for constructors and some members. #1820

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dbiswas2808
Copy link

More coord constructors can be constexpr. Have found this useful for writing complex finite difference operations using neighboring cells.
A simple example of usage:

Coord p; // Some input coord

// Find this pattern much easier to debug and follow for even larger number of neighbors.
constexpr Coord n0Off{1, 0};
constexpr Coord n1Off{-1, 0};
constexpr Coord n2Off{0, 1};
constexpr Coord n3Off{0, -1};

auto dx  = ((p + n0Off) - (p + n1Off)) / 2 ;
auto dy  = ((p + n2Off) - (p + n3Off)) / 2 ;

@dbiswas2808 dbiswas2808 requested a review from kmuseth as a code owner May 18, 2024 13:29
Copy link

linux-foundation-easycla bot commented May 18, 2024

CLA Missing ID CLA Not Signed

@dbiswas2808 dbiswas2808 force-pushed the MakeCoordConstexpr branch from 883a7ce to 6a23cfa Compare May 18, 2024 13:33
@dbiswas2808
Copy link
Author

/easycla

@dbiswas2808
Copy link
Author

Not sure why easyCLA is not getting retriggered.

@dbiswas2808 dbiswas2808 force-pushed the MakeCoordConstexpr branch from 6a23cfa to 8212597 Compare May 21, 2024 23:40
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.

1 participant