Skip to content

Commit

Permalink
fix: user-defined literal operator syntax (to make clang20 happy) (#3992
Browse files Browse the repository at this point in the history
)

- fix: user-defined literal operator syntax

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Updated user-defined literal operators for various unit constants to enhance naming consistency.
  - Standardized the operator signature for the hashing function to improve clarity.

- **Bug Fixes**
  - No specific bug fixes were addressed in this release.

- **Documentation**
  - Changes in function signatures documented for better understanding of updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
flg authored Dec 18, 2024
1 parent 2bb167c commit 9269562
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Core/include/Acts/Definitions/Units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ constexpr double mol = 1.0;

namespace UnitLiterals {
// define user literal functions for the given unit constant
#define ACTS_DEFINE_UNIT_LITERAL(name) \
constexpr double operator"" _##name(long double x) { \
return ::Acts::UnitConstants::name * x; \
} \
constexpr double operator"" _##name(unsigned long long x) { \
return ::Acts::UnitConstants::name * x; \
#define ACTS_DEFINE_UNIT_LITERAL(name) \
constexpr double operator""_##name(long double x) { \
return ::Acts::UnitConstants::name * x; \
} \
constexpr double operator""_##name(unsigned long long x) { \
return ::Acts::UnitConstants::name * x; \
}
ACTS_DEFINE_UNIT_LITERAL(fm)
ACTS_DEFINE_UNIT_LITERAL(pm)
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/Utilities/HashedString.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ constexpr HashedString hashStringDynamic(std::string_view s) {
}

namespace HashedStringLiteral {
constexpr HashedString operator"" _hash(char const* s, std::size_t count) {
constexpr HashedString operator""_hash(char const* s, std::size_t count) {
return detail::fnv1a_32(s, count);
}

Expand Down

0 comments on commit 9269562

Please sign in to comment.