-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add infrastructure for working with concepts
This commit adds the `TRACCC_CONSTRAINT` macro which acts as a concept in C++20 builds, and simply acts as the `typename` keyword in builds with older standards. It also adds the `TRACCC_ENFORCE_CONCEPTS` CMake flag which will throw an error if concepts are not available.
- Loading branch information
1 parent
b3f0d86
commit 53213c8
Showing
6 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* traccc library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#if __cpp_concepts >= 201907L | ||
#define TRACCC_CONSTRAINT(...) __VA_ARGS__ | ||
#elif defined(TRACCC_ENFORCE_CONCEPTS) | ||
#error \ | ||
"`TRACCC_ENFORCE_CONCEPTS` is set, but concepts are not available. This constitutes a fatal error." | ||
#else | ||
#define TRACCC_CONSTRAINT(...) __VA_ARGS__ | ||
#endif |