File tree Expand file tree Collapse file tree 3 files changed +27
-15
lines changed Expand file tree Collapse file tree 3 files changed +27
-15
lines changed Original file line number Diff line number Diff line change @@ -80,11 +80,15 @@ template <size_t Id, typename Name = void> struct captured_content {
80
80
} else { // I'm doing this to avoid warning about dead code
81
81
#endif
82
82
83
- #if __cpp_lib_to_address >= 201711L
84
- return std::to_address (_begin);
85
- #else
86
- return &*_begin;
87
- #endif
83
+ if constexpr (std::is_pointer_v<Iterator>) {
84
+ return _begin;
85
+ } else {
86
+ #if __cpp_lib_to_address >= 201711L
87
+ return std::to_address (_begin);
88
+ #else
89
+ return &*_begin;
90
+ #endif
91
+ }
88
92
89
93
#if __cpp_char8_t >= 201811
90
94
}
Original file line number Diff line number Diff line change @@ -3368,11 +3368,15 @@ template <size_t Id, typename Name = void> struct captured_content {
3368
3368
} else { // I'm doing this to avoid warning about dead code
3369
3369
#endif
3370
3370
3371
- #if __cpp_lib_to_address >= 201711L
3372
- return std::to_address(_begin);
3373
- #else
3374
- return &*_begin;
3375
- #endif
3371
+ if constexpr (std::is_pointer_v<Iterator>) {
3372
+ return _begin;
3373
+ } else {
3374
+ #if __cpp_lib_to_address >= 201711L
3375
+ return std::to_address(_begin);
3376
+ #else
3377
+ return &*_begin;
3378
+ #endif
3379
+ }
3376
3380
3377
3381
#if __cpp_char8_t >= 201811
3378
3382
}
Original file line number Diff line number Diff line change @@ -3365,11 +3365,15 @@ template <size_t Id, typename Name = void> struct captured_content {
3365
3365
} else { // I'm doing this to avoid warning about dead code
3366
3366
#endif
3367
3367
3368
- #if __cpp_lib_to_address >= 201711L
3369
- return std::to_address (_begin);
3370
- #else
3371
- return &*_begin;
3372
- #endif
3368
+ if constexpr (std::is_pointer_v<Iterator>) {
3369
+ return _begin;
3370
+ } else {
3371
+ #if __cpp_lib_to_address >= 201711L
3372
+ return std::to_address (_begin);
3373
+ #else
3374
+ return &*_begin;
3375
+ #endif
3376
+ }
3373
3377
3374
3378
#if __cpp_char8_t >= 201811
3375
3379
}
You can’t perform that action at this time.
0 commit comments