Skip to content

Commit d945f41

Browse files
committed
fix: compiler define __cpp_pack_indexing even for versions lower than C++26
1 parent cc3bf00 commit d945f41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/include/mp-units/bits/type_list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ using type_list_map = type_list_map_impl<From, To>::type;
7272

7373

7474
// element
75-
#ifdef __cpp_pack_indexing
75+
#if defined(__cpp_pack_indexing) && __cplusplus > 202302
7676

7777
// C++26: Pack indexing (P2662) gives a compiler-native O(1) element access,
7878
// eliminating the indexed_type_list multiple-inheritance machinery entirely.
@@ -174,7 +174,7 @@ using type_list_join = type_list_join_impl<Lists...>::type;
174174
template<typename List, typename First, typename Second>
175175
struct type_list_split_impl;
176176

177-
#ifdef __cpp_pack_indexing
177+
#if defined(__cpp_pack_indexing) && __cplusplus > 202302
178178

179179
// C++26: Direct pack indexing avoids building an indexed_type_list (N base classes)
180180
// and then re-traversing it for every element of both output lists.

0 commit comments

Comments
 (0)