Skip to content

Commit

Permalink
FORCEINLINE
Browse files Browse the repository at this point in the history
  • Loading branch information
BrendanKKrueger committed Aug 28, 2024
1 parent 5bcb3fd commit b1f21fe
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ports-of-call/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ struct bits {
using type = T[N];

template <typename IntT>
PORTABLE_FUNCTION static constexpr T &ref_access(type &array,
PORTABLE_FORCEINLINE_FUNCTION static constexpr T &ref_access(type &array,
IntT index) {
return array[index];
}

template <typename IntT>
PORTABLE_FUNCTION static constexpr T const &
PORTABLE_FORCEINLINE_FUNCTION static constexpr T const &
ref_access(type const &array, IntT index) {
return array[index];
}

PORTABLE_FUNCTION static constexpr T *ptr_access(type &array) {
PORTABLE_FORCEINLINE_FUNCTION static constexpr T *ptr_access(type &array) {
return static_cast<T *>(array);
}

PORTABLE_FUNCTION static constexpr T const *
PORTABLE_FORCEINLINE_FUNCTION static constexpr T const *
ptr_access(type const &array) {
return static_cast<T const *>(array);
}
Expand All @@ -57,21 +57,21 @@ struct bits<T, 0> {
using type = T[1];

template <typename IntT>
PORTABLE_FUNCTION static constexpr T &ref_access(type &arr, IntT) {
PORTABLE_FORCEINLINE_FUNCTION static constexpr T &ref_access(type &arr, IntT) {
return arr[0];
}

template <typename IntT>
PORTABLE_FUNCTION static constexpr T const &ref_access(type const &arr,
PORTABLE_FORCEINLINE_FUNCTION static constexpr T const &ref_access(type const &arr,
IntT) {
return arr[0];
}

PORTABLE_FUNCTION static constexpr T *ptr_access(type &arr) {
PORTABLE_FORCEINLINE_FUNCTION static constexpr T *ptr_access(type &arr) {
return (T *)&arr;
}

PORTABLE_FUNCTION static constexpr T const *
PORTABLE_FORCEINLINE_FUNCTION static constexpr T const *
ptr_access(type const &arr) {
return (T const *)&arr;
}
Expand Down

0 comments on commit b1f21fe

Please sign in to comment.